Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Namespaces cannot be found while the program runs normally #434

Closed
TheOnlylight opened this issue May 19, 2020 · 11 comments
Closed

Namespaces cannot be found while the program runs normally #434

TheOnlylight opened this issue May 19, 2020 · 11 comments
Labels
area: editor Extensions for Visual Studio and Visual Studio Code bug Something isn't working

Comments

@TheOnlylight
Copy link

I use the vscode on Win10, with .net 3.1.4
the VScode reported red on the namespaces fro Q#, however the program managed to build and run properly ,this is so werid
image
image

@cgranade
Copy link
Contributor

Thanks for the report, @TheOnlylight! I'll go on and transfer this to the qsharp-compiler repo where we track extension issues, but in the meantime, would you be willing to share the contents of the Q# Language Extension tab of the Output pane? You can get to this pane by going to View → Output, then selecting "Q# Language Extension":

image

image

That additional information will be really helpful in diagnosing the issue that you encountered. Thanks!

@cgranade cgranade transferred this issue from microsoft/Quantum May 19, 2020
@valdaarhun
Copy link

Hi. I too am facing this issue. The program works even though I get errors stating that the namespaces could not be found.
I am using vs code with .net 3.1.300. The version of the windows OS that I am using is 6.1.7601.
Console
Screen
The screenshot below shows the contents of the Q# Language Extension tab of the Output pane.
Output

@bettinaheim
Copy link
Contributor

bettinaheim commented May 20, 2020

Yes, the output clarifies what the issue is! Thanks, @valdaarhun! It looks like the package that we are using for the design time build is older than the dotnet version you are using. We can update that with our next release. Thanks for pointing it out!
@ricardo-espinoza It would be good if we could find a more permanent solution than having to explicitly reference and update the NuGet.Frameworks package.

@bettinaheim
Copy link
Contributor

See also microsoft/MSBuildLocator#86

@venkyms
Copy link

venkyms commented May 31, 2020

Same namespace issue occurs in mac version as well. Below are the details

Mac version : 10.15.5 
VS code version : 1.45.1
dotnet core version : 3.1.300
Q# extension version: 0.11.20042825

Error Message from the output window(Q# Language Extension)

[Error - 5:42:29 PM] MSBuild error in /usr/local/share/dotnet/sdk/3.1.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks, Version=5.6.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

File name: 'NuGet.Frameworks, Version=5.6.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Is there any work arround for this issue, until this get patched ? Thanks.

@bamarsha bamarsha added area: editor Extensions for Visual Studio and Visual Studio Code bug Something isn't working labels Jun 8, 2020
@bettinaheim
Copy link
Contributor

@venkyms I believe this issue should indeed be fixed with the June 4th release.
Unfortunately it might temporarily reoccur until this is fixed or we find an alternative. The workaround in the case of reoccurrence would be to not use the latest dotnet version until we've had a chance to update the package as part of our release.

@valdaarhun
Copy link

Hi. I would like to point out that after updating vscode the errors no longer appear and the program runs properly.

@abidart
Copy link

abidart commented Aug 23, 2020

Hello everyone, I think this might be happening again, but with a new version of NuGet.Frameworks. I am experiencing the same issue while following the steps of the tutorial: Exercise - Install the QDK for Visual Studio Code (https://docs.microsoft.com/en-us/learn/modules/qsharp-create-first-quantum-development-kit/2-install-quantum-development-kit-code).

I am using MacOS Mojave 10.14.6 with dotnet version 3.1.401.

Here is the log (with the paths to the project edited out)

[Info  - 8:46:39 PM] workspace folder: [edited]
[Error - 8:46:40 PM] MSBuild error in /usr/local/share/dotnet/sdk/3.1.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks, Version=5.7.0.7, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

File name: 'NuGet.Frameworks, Version=5.7.0.7, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)


[Error - 8:46:40 PM] Failed to restore project [edited]
[Error - 8:46:40 PM] MSBuild error in /usr/local/share/dotnet/sdk/3.1.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'NuGet.Frameworks, Version=5.7.0.7, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

File name: 'NuGet.Frameworks, Version=5.7.0.7, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)


[Error - 8:46:40 PM] Failed to resolve assembly references for project [edited]
Discovered Q# project [edited]
Loading project [edited]
Done loading project [edited]

@bamarsha
Copy link
Contributor

Hi @abidart, that looks like the same problem as #558. It should be fixed in the next release sometime this week. :) Hopefully, the fix is permanent this time and should continue to work with newer .NET Core versions.

@alfogo
Copy link

alfogo commented Jan 13, 2021

Hi, any update on this?. I'm on Quantum Dev Kit 0.14.2011.120240 with .net core sdk 3.1.405 and getting exactly same issue

@bamarsha
Copy link
Contributor

Hi @alfogo, this issue was fixed in August, and QDK 0.14.2011120240 should work with .NET Core 3.1.405 SDK. I'm not sure what's causing the problem you're seeing, unfortunately. Could you create a new GitHub issue for it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: editor Extensions for Visual Studio and Visual Studio Code bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants