Currently CopyLocalLockFileAssemblies is set to true and dotnet copies assemblies without pdb files and documentation xml files. This means that pdb files are not found and debugging is limited.
Workaround
Add a line <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies> to the project file as shown below for the case of Test projects.
namespace qsharp_unit_test_example {
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Diagnostics;
open Microsoft.Quantum.Intrinsic;
operation FailH ( q : Qubit) : Unit {
H(q);
fail "d";
}
@Test("QuantumSimulator")
operation AllocateQubit2 () : Unit {
using( qs = Qubit[5] ) {
ApplyToEach(FailH, qs);
}
}
}
With this option enabled call stack error message (line 4) points to GitHub as following:
Standard Output Messages:
Unhandled exception. Microsoft.Quantum.Simulation.Core.ExecutionFailException: d
---> qsharp_unit_test_example.FailH on D:\repos\qsharp-unit-test-example\Tests.qs:line 10
at Microsoft.Quantum.Canon.ApplyToEach on https://github.com/microsoft/QuantumLibraries/blob/7327e6a9901b2fede48797fb8537982b87df545a/Standard/src/Canon/Combinators/ApplyToEach.qs#L155
at qsharp_unit_test_example.AllocateQubit2 on D:\repos\qsharp-unit-test-example\Tests.qs:line 16
Without the option enabled error (line 4) points to path on build machine, it looks like:
Standard Output Messages:
Unhandled exception. Microsoft.Quantum.Simulation.Core.ExecutionFailException: d
---> qsharp_unit_test_example.FailH on D:\repos\qsharp-unit-test-example\Tests.qs:line 10
at Microsoft.Quantum.Canon.ApplyToEach on D:\a\1\s\submodules\QuantumLibraries\Standard\src\Canon\Combinators\ApplyToEach.qs:line 0
at qsharp_unit_test_example.AllocateQubit2 on D:\repos\qsharp-unit-test-example\Tests.qs:line 0
Isssue
Currently
CopyLocalLockFileAssemblies
is set totrue
and dotnet copies assemblies without pdb files and documentation xml files. This means thatpdb
files are not found and debugging is limited.Workaround
Add a line
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
to the project file as shown below for the case of Test projects.Context
For the following test file:
With this option enabled call stack error message (line 4) points to GitHub as following:
Without the option enabled error (line 4) points to path on build machine, it looks like: