1

I built a devcontainer on Windows, via Rider 2025.2, and I could run it and launch the rider IDE then load the project.

When I build or restore nuget packages in the project, using dotnet command, I get No error! Everything runs well!

But when I build the project with Rider, I get this silly error:

0>Microsoft.PackageDependencyResolution.targets(266,5): Error MSB4018 : The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages'.
 at NuGet.Packaging.FallbackPackagePathResolver..ctor(String userPackageFolder, IEnumerable`1 fallbackPackageFolders)
 at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver(IEnumerable`1 packageFolders)
 at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task)
 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.Execute()
 at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

This error clearly shows a Windows path, despite the fact that the container's image is linux, the files are in a Linux file system, and everything .NET in the project's container is on Linux. Only the host OS is Windows.

I searched a solution extensively and could only find a solution to this problem on VS Code, but not on Rider! Does anyone know how to resolve this annoying error ?

marc_s
760k186 gold badges1.4k silver badges1.5k bronze badges
asked Sep 4, 2025 at 16:14
7
  • Could you check the value of <RestoreFallbackFolders> in your csproj? It looks like Rider might be incorrectly expanding special value in this property Commented Sep 4, 2025 at 16:44
  • You need to use this props/targets file to separate the windows/Linux build. Then remove the bin/obj folders and restart VS Commented Sep 4, 2025 at 19:23
  • @kf-jb I didn't set a value for "RestoreFallbackFolders" Commented Sep 5, 2025 at 9:01
  • 1
    It should. Did you shutdown VS, remove all bin/obj folders + the .vs folder, remove your devcontainer image through Docker Desktop, and restart visual studio, then open your devcontainer? It should work if the files are in the repository root. I use it all the time Commented Sep 5, 2025 at 10:55
  • 1
    I just created a demo repository here with the expected result Commented Sep 5, 2025 at 11:29

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.