0
votes

I've just created an ASP.NET application with .NET core and when I tried to run it says: Error NETSDK100 file 'C:\Users\mauro\source\repos\WebApplication3\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

I've run the dotnet restore command and say this:

 dotnet : System.AggregateException: One or more errors occurred. (One or more errors occurred. (Cannot create 'C:\ProgramFiles\dotnet\sdk\NuGetFallbackFolder\system.linq.expressions\4.3.0\lib\xamarintvos10' because a file or directory with the same name already exists.)

I also tried reinstalling .net core and visual studio 2019 and it doesn't works. Any Idea?

1
Did you check the existance of the folder?Jeroen Heier
NuGetFallbackFolder is normally read only, and NuGet usually only writes to packages folders, which suggests to me that you have a nuget.config that changes globalPackagesFolder, or have a MSBuild property RestorePackagesPath, that points to the fallback folder.zivkan
@mauro3g, hi friend, any update for this issue? You can try the answer from cdev's comment, also you can follow zivkan's suggestion to trouble-shooting. Feel free to let us know if this issue is solved or not : )LoLance

1 Answers

0
votes

Had identical problem. Resolved it by removing a test project from my solution that had target .NET core 2.1. All other projects in the solution were .NET framework 4.6.2. The mismatch was creating the problem for the NuGet package restore on the DevOps pipeline.

So, consider checking the projects in your solution to ensure they are all targeting ".NET Core" xor ".NET framework".

The xor is intentional for those that know.