当Visual Studio工作时,MSBuild无法构建解决方案

时间:2017-03-21 18:22:59

标签: c# visual-studio msbuild visual-studio-2017

我尝试在我的小github存储库中添加CI支持,因此我将其配置为使用appveyor。但它无法构建我的解决方案,并且因为奇怪的错误而失败。但它有一个构建日志,所以我在我的控制台重新输入它们并遇到完全相同的问题,多个奇怪的错误,如The type or namespace name 'System' could not be found

git clone -q --branch=master https://github.com/Pzixel/RemoteClient.git C:\projects\remoteclient
msbuild "C:\projects\remoteclient\RemoteClient\RemoteClient.sln" /verbosity:minimal

enter image description here 在AppVeyor中也是如此:https://ci.appveyor.com/project/Pzixel/remoteclient

然而VS2017对它很好: enter image description here

为什么会发生这种情况?如何修复?

1 个答案:

答案 0 :(得分:2)

我认为在构建解决方案之前,您需要恢复nuget包。您可以下载nuget.exe here

比你可以跑:

nuget restore RemoteClient.sln
msbuild RemoteClient.sln

我做了一个干净的结帐并运行两个命令。