[英]NuGet Package Manager - Project 'Default' is not found. - Visual Studio 2017
我正在使用 Visual Studio 2017 社區,我正在嘗試為我剛剛開始工作的項目構建解決方案。
每當我嘗試構建解決方案文件時,都會收到以下錯誤:
C:\Projects\UnitTests\UnitTests.csproj(91,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props.
C:\Projects\WebAPI\WebAPI.csproj(469,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props.
C:\Projects\APITester\APITester.csproj(316,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props.
C:\Projects\Admin\Admin.csproj(391,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props.
如果我試着跑
Update-Package --reinstall
或者
Install-Package Microsoft.Net.Compilers -Version 2.6.1
我收到以下錯誤:
Install-Package : Project 'Default' is not found.
At line:1 char:1
+ Install-Package Microsoft.Net.Compilers -Version 2.6.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Update-Package : Project 'Default' is not found.
At line:1 char:1
+ Update-Package --reinstall
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Default:String) [Update-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
打開這些項目的解決方案,因為這將自動設置默認項目。 然后你就可以安裝這些 nuget 包了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.