Unable to find fallback package folder '/usr/share/dotnet/sdk/NuGetFallbackFolder'
See original GitHub issueIssue 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:
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
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)
DotNetPath set to dotnet
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"
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'
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
Detecting Cake files in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend'.
Could not find any Cake files
No solution files found in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend'
Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Detecting CSX files in 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend'.
Could not find any CSX files
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
Loading project: d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
Configuration finished.
Omnisharp server running using Stdio at location 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend' on host 21628.
Successfully loaded project file 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'.
Adding project 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Update project: LicznikNET.Modules
Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Queue project update for 'd:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj'
Loading project: d:\TheCloudTheory\Apps\LicznikNET\LicznikNET.Backend\LicznikNET.Modules\LicznikNET.Modules.csproj
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, IEnumerable
1 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()
Update project: LicznikNET.Modules</details>
C# log
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: 729b316c13Runtime 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 |
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
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.
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)?