microsoft / QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing
MIT License
4.55k stars 1.22k forks source link

VS can't find the tests #316

Closed TTeschitsch closed 4 years ago

TTeschitsch commented 4 years ago

Hello,

My Visual Studio can't find the tests for the katas (I first tried with BasicGates).

I have an error in the ouput pane - Tests (message in attachment). The basic "Hello world" application works great and the build of Basic Gates is successful.

I have VS2019 Pro with .NET Core 3.1 and I cloned the git repository without any modification.

Thanks for your help! error.txt

bettinaheim commented 4 years ago

Hi @TTeschitsch, Could you try adding <PlatformTarget>x64</PlatformTarget> to the test project file? It shouldn't be needed, but it's a quick thing to try.

TTeschitsch commented 4 years ago

This is already set to x64 :(

tcNickolas commented 4 years ago

Could you please provide more details on your setup?

TTeschitsch commented 4 years ago
bettinaheim commented 4 years ago

It looks like your dotnet version is not installed properly. The BadImageFormatException is usually related to a discrepancy between x64 and x86. Could you uninstall the 3.1.201 version using the control panel, then click on the "Download .NET Core Sdk" button here, and install the downloaded dotnet by double clicking it? The dotnet --version command should hopefully succeed after that.

TTeschitsch commented 4 years ago

Now, the dotnet --version command returns "2.2.203" :( I think this is because I have sdks installed here : C:\Program Files (x86)\dotnet\sdk.

I renamed "dotnet" to "dotnet-old" (in the x86 folder) and, this time, the command line returns : "3.1.201" ! And the unit tests work :)

Thanks for the help !