我研究了这个问题,但没有一个解决办法有效。我安装了Visual Studio Professional 2015,我正在使用TFS。我的NuGet版本是3.1.6。这个问题只发生在我的c# Web API/MVC项目中。
我得到以下错误:
这个项目引用了NuGet包(s),这是缺失的
电脑。使用NuGet包还原来下载它们。更多的
信息,见http://go.microsoft.com/fwlink/?LinkID=322105。的
丢失的文件是
. . \ \ Microsoft.Net.Compilers.1.0.0 \制造\ Microsoft.Net.Compilers.props包
I do not have .nuget folder in my solutions.
I have a packages folder in the solution and when I delete it, it seems like NuGet does rebuild the dependencies but the project still has the above error.
I tried removing the project from TFS and it didn't fix it.
Along with the above error, all the references in the project have yellow warning signs and say they are missing.
When I checked the NuGet Package Manager for the project, everything that is "missing" has a green tick next to it, including Microsoft.Net.Compilers.
I tried adding a new Web API/MVC project and it faced a similar problem where most references such as Owin were "missing" with the yellow warning sign.
Not sure if this will help anyone, but I had this issue come up when I deleted the source code from my local machine without having ever saved the solution file to TFS. (During initial development, I was right-clicking and checking in the project in Solution Explorer, but forgot to ever check in the solution itself.) When I needed to work on this again, all I had in TFS was the .csproj file, no .sln file. So in VS I did a File --> Source Control --> Advanced -- Open from Server and opened the .csproj file. From there I did a Save All and it asked me where I wanted to save the .sln file. I was saving this .sln file to the project directory with the other folders (App_Data, App_Start, etc.), not the top level directory. I finally figured out that I need to save the .sln file up a directory from the project folder so it's on the same level as the project folder. All my paths resolved and I was able to build it again.
错误信息是完全正确的。我试了所有的花招,没有一个奏效。项目(简单的MVC Web应用程序测试)从Windows 8.1 VS 2015社区转移到我在Windows 10上的新测试箱。所有VS 2015的最新更新都适用。
我甚至无法安装任何更新版本的编译器包。
Loop:
<LOOP>This seems to be a Ground Hog Day phenomena.</LOOP>
GoTo Loop
我最终只是将Microsoft.Net.Compilers.1.0.0从旧项目复制到新项目中,它工作了。
然后我可以开始将其他包更新到新版本。
在我看来是nuget项目升级过程的bug。
注意:最初的项目是在VS 2015中创建的,没有任何遗留的nuget方法。