Assets file project.assets.json not found. Run a NuGet package restore

后端 未结 30 911
孤城傲影
孤城傲影 2020-11-28 20:02

I\'m trying to use nopCommerce(Which is written in .NET Core) but when I want to run the project I face 52 Errors telling me Run a nuget package restore

30条回答
  •  情深已故
    2020-11-28 20:48

    If this error occurs as part of a build in Azure DevOps (TFS) and your build already has a NuGet restore task, this error may indicate the NuGet restore task was not able to restore all packages, especially if you use a custom package source (such as an internal NuGet server). Adding /t:Restore;Build to the MSBuild Arguments seems to be one way to resolve the error, but this asks MSBuild to perform an additional NuGet restore operation. I believe this succeeds because MSBuild uses the custom package source configured in Visual Studio. A preferable solution is to fix the NuGet restore task.

    To configure a custom package source for the NuGet restore task:

    1. Create a NuGet.config file that lists all of the package sources (Microsoft Visual Studio Offline Packages, nuget.org, and your custom package source) and add it to source control.
    2. In the Nuget restore task under Feeds to use: select the option Feeds in my NuGet.config.
    3. Provide the path to NuGet.config.
    4. Remove the /t:Restore;Build option from the MSBuild task.

    Additional information is available here.

提交回复
热议问题