简体   繁体   English

如何修复错误 NETSDK1 project.assets.json 文件未找到。 运行 NuGet 包还原以生成此文件

[英]How to fix error NETSDK1 project.assets.json file not found. Run a NuGet package restore to generate this file

I cannot run my new .netcore mvc application.我无法运行我的新 .netcore mvc 应用程序。 The dependencies always show warning icon.依赖项总是显示警告图标。警告图标

And I got this error message when run my new asp.net mvc application运行我的新 asp.net mvc 应用程序时收到此错误消息错误信息after a few hours of searching, I got a few answers.经过几个小时的搜索,我得到了一些答案。 but the answer still cannot be applied to run my application.但答案仍然无法应用于运行我的应用程序。 I have tried using dotnet restore , nuget restore , dotnet build , etc. but still no one solved this problem.我曾尝试使用dotnet restorenuget restoredotnet build等,但仍然没有人解决这个问题。 when I run dotnet restore this message appears当我运行dotnet restore出现此消息恢复后报错

when I run nuget restore this message appears当我运行nuget restore出现此消息错误 nuget 还原

Previously I used Microsoft Visual Studio 2017. I uninstalled it and replaced it with Microsoft Visual Studio 2019. Was there something conflict when I installed Microsoft Visual Studio 2019?之前我用的是Microsoft Visual Studio 2017,卸载了,换成了Microsoft Visual Studio 2019,安装Microsoft Visual Studio 2019时有冲突吗?

I just want to run my application.我只想运行我的应用程序。 but I don't know what's wrong with my application?但我不知道我的申请有什么问题?

Hopefully some of you can help me.希望你们中的一些人可以帮助我。 Thank you in advance先感谢您

In order to fix this error, open visual studio, then select Tools > NuGet Package Manager > Package Manager Console.要修复此错误,请打开 Visual Studio,然后选择“工具”>“NuGet 包管理器”>“包管理器控制台”。 Once the Package Manager Console window is open, simply type the below command press enter button.打开包管理器控制台窗口后,只需键入以下命令按回车键。

dotnet restore dotnet 还原

  • dotnet restore {Directory of Solution}{Name of the solution} dotnet restore {解决方案目录}{解决方案名称}

  • Hit Enter按回车键

  • It will work, restore all the nuget packages/dependencies它将起作用,恢复所有 nuget 包/依赖项

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:找不到“project.assets.json”。 运行 NuGet 包还原以生成此文件 - Error: 'project.assets.json' not found. Run a NuGet package restore to generate this file 错误 NETSDK1004:找不到资产文件“project.assets.json” - Error NETSDK1004: Assets file 'project.assets.json' not found error NETSDK1004 Assets file project.assets.json not found and error MSB4036 The “GetReferenceNearestTargetFrameworkTask” task is not found - error NETSDK1004 Assets file project.assets.json not found and error MSB4036 The “GetReferenceNearestTargetFrameworkTask” task was not found .NET Core 网站不会在 OS X 上构建 - “未找到资产文件 '.../obj/project.assets.json'。” - A .NET Core website won't build on OS X - “Assets file '…/obj/project.assets.json' not found.” msbuild 找不到 project.assets.json - project.assets.json not found with msbuild 得到错误资产文件'obj\project.assets.json'没有'.NETCoreApp,Version = v2.2'的目标 - get error Assets file 'obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2' 资产文件 obj\project.assets.json 没有目标 - VS2017 - Assets file obj\project.assets.json doesn't have a target - VS2017 如何修复:在项目文件的“TargetFrameworks”属性中添加对“.NETFramework,Version=v4.7.1”的引用,然后重新运行 NuGet 恢复? - How to fix: Add a reference to ".NETFramework,Version=v4.7.1" in the "TargetFrameworks" property of your project file and then re-run NuGet restore? nuget恢复后找不到文件 - File was not found after nuget restore 将文件传输到另一个系统后出现问题(错误 NETSDK1) - Problem after transferring files to another system (error NETSDK1)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM