question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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)
    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, 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()

    Update project: LicznikNET.Modules</details>

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
filipwcommented, Aug 9, 2019

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.

0reactions
emhackercommented, Oct 22, 2020

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)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

where does the "Unable to find fallback package folder" nuget ...
PackagingException: Unable to find fallback package folder '/usr/local/share/dotnet/sdk/NuGetFallbackFolder'. [/src/test/test.fsproj] at NuGet.
Read more >
Unable to find fallback package folder #9180 - dotnet/sdk
PackagingException: Unable to find fallback package folder 'C:\Users\cipop\.dotnet\NuGetFallbackFolder'. [S:\cs\security\tpm\src\Microsoft.
Read more >
Unable to find fallback package folder 'C:\Program Files (x86 ...
I'm just trying to build the stock .NET Core Console app in Visual Studio 2019 Enterprise; I'm using the latest version of VS....
Read more >
NuGet Package Restore Failing on Fallback Folder
PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'.
Read more >
Unable to uninstall DevExpress 20.2
PackagingException: Unable to find fallback package folder 'D:\DevExpress 20.2\Components\Offline Packages'. at NuGet.Packaging.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found