0

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?

mauro3g
  • 1
  • 1
  • 2
  • Did you check the existance of the folder? – Jeroen Heier Jun 27 '19 at 03:53
  • Duplicates https://stackoverflow.com/questions/48440223/assets-file-project-assets-json-not-found-run-a-nuget-package-restore – cdev Jun 27 '19 at 04:02
  • `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 Jun 27 '19 at 14:36
  • @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 Jun 28 '19 at 09:33

1 Answers1

0

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.

David Rupe
  • 103
  • 1
  • 7