vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Unable to find fallback package folder '/usr/share/dotnet/sdk/NuGetFallbackFolder'

Open kamil-mrzyglod opened this issue 7 years ago • 5 comments

Issue Description

VS Code constatly notifies me, that it cannot load a project or it has difficulties loading it. The project may build fine and work, still Omnisharp seems to either not see dependencies, all completely fail even on .NET assemblies.

When I delete bin/obj folders, the things become even funnier: image

Steps to Reproduce

Create a new project .NET project(classlib) using dotnet new from WSL terminal in VS Code.

Expected Behavior

C# projects should be loaded fine, I should be able to browse classes and access symbols.

Actual Behavior

C# projects go crazy and even framework classes are marked as missing.

Logs

OmniSharp log

Starting OmniSharp server at 8.08.2019, 10:11:01 Target: d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend

OmniSharp server started. Path: C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0\OmniSharp.exe PID: 20692

Starting OmniSharp on Windows 6.2.9200.0 (x64) info: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 1 MSBuild instance(s) 1: StandAlone 16.0 - "C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin" info: OmniSharp.MSBuild.Discovery.MSBuildLocator MSBUILD_EXE_PATH environment variable set to 'C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin\MSBuild.exe' info: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: StandAlone 16.0 - "C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin" CscToolExe = csc.exe CscToolPath = C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin\Roslyn MSBuildExtensionsPath = C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild MSBuildToolsPath = C:\Users\kamz.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin info: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend'. info: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files info: OmniSharp.MSBuild.ProjectSystem No solution files found in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend'. info: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files info: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 info: OmniSharp.MSBuild.ProjectManager Loading project: d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj info: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 info: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200 info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend' on host 21628. info: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'. info: OmniSharp.MSBuild.ProjectManager Adding project 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.MSBuild.ProjectManager Update project: LicznikNET.Modules info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj' info: OmniSharp.MSBuild.ProjectManager Loading project: d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj [fail]: OmniSharp.MSBuild.ProjectLoader The "ResolvePackageAssets" task failed unexpectedly. NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder '/usr/share/dotnet/sdk/NuGetFallbackFolder'. at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable1 fallbackPackageFolders) at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(LockFile lockFile, String projectPath) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task, Stream stream) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() at Microsoft.NET.Build.Tasks.TaskBase.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [warn]: OmniSharp.MSBuild.ProjectManager Failed to load project file 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'. d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj C:\Program Files\dotnet\sdk\2.2.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): Error: The "ResolvePackageAssets" task failed unexpectedly. NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder '/usr/share/dotnet/sdk/NuGetFallbackFolder'. at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable1 fallbackPackageFolders) at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(LockFile lockFile, String projectPath) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task, Stream stream) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromDisk(ResolvePackageAssets task, Byte[] settingsHash) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task) at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups() at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore() at Microsoft.NET.Build.Tasks.TaskBase.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

Update project: LicznikNET.Modules

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.36.1 C# Extension: 1.21.0

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.401 Commit: 729b316c13

Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.2.401\

Host (useful for support): Version: 2.2.6 Commit: 7dac9b1b51

.NET Core SDKs installed: 2.2.401 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
azure-account ms-vscode 0.8.4
azurerm-vscode-tools msazurermtools 0.6.0
csharp ms-vscode 1.21.0
gitlens eamodio 9.9.3
Go ms-vscode 0.11.4
markdown-all-in-one yzhang 2.4.2
powershell ms-vscode 2019.5.0
shell-format foxundermoon 6.1.1
terraform mauve 1.3.12
vscode-azurefunctions ms-azuretools 0.17.2-alpha
vscode-azureterraform ms-azuretools 0.2.4
vscode-docker ms-azuretools 0.7.0
xml DotJoshJohnson 2.5.0

kamil-mrzyglod avatar Aug 08 '19 08:08 kamil-mrzyglod

In my case the folder exists:

kamz@pl-c-waw-kamz-1:/usr/share/dotnet/sdk/NuGetFallbackFolder$ ls
2.2.401.dotnetSentinel                                      microsoft.azure.services.appauthentication                                     runtime.win-arm64.runtime.native.system.data.sqlclient.sni
libuv                                                       microsoft.codeanalysis.analyzers                                               runtime.win-x64.runtime.native.system.data.sqlclient.sni
messagepack                                                 microsoft.codeanalysis.common                                                  runtime.win-x86.runtime.native.system.data.sqlclient.sni
microsoft.applicationinsights                               microsoft.codeanalysis.csharp                                                  sqlitepclraw.bundle_green
microsoft.applicationinsights.aspnetcore                    microsoft.codeanalysis.razor                                                   sqlitepclraw.core
...

kamil-mrzyglod avatar Aug 09 '19 07:08 kamil-mrzyglod

OmniSharp runs on the Windows file system and the WSL file system is not available to it, this is a known problem. Same thing happens i.e. if you create a dotnet project on a Mac and then try to use it with OmniSharp on Windows in a VM.

You should restore your project from the Windows command line as a workaround.

filipw avatar Aug 09 '19 07:08 filipw

@filipw All right, will try the workaround. Is there any issue one can track to check whether WSL is supported?

kamil-mrzyglod avatar Aug 09 '19 07:08 kamil-mrzyglod

@kamil-mrzyglod You should use VS Code Remote for WSL instead of trying to edit a project on the WSL filesystem: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl

rchande avatar Aug 09 '19 18:08 rchande

Encountered the same issue, and I confirm that the workaround worked for me. I just wonder - is there a way to manually configure which OmniServer executable to connect to? (e.g., Linux, Windows)?

emhacker avatar Oct 22 '20 12:10 emhacker