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 ?
<RestoreFallbackFolders>in your csproj? It looks like Rider might be incorrectly expanding special value in this property.vsfolder, 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