我正在visualstudio2013中尝试构建一个web API项目,该项目已从git下载。
然而,每当我试图构建它时,都会产生以下错误。有人能提出任何帮助来解决这个问题吗。
我使用windows 8.1
和visual studio 2013
版本4。
错误消息:
错误1
此版本的F:\WebApi\WebApi.nuget\nuget.exe不兼容使用您正在运行的Windows版本。检查您的计算机系统信息,然后联系软件发行商。
错误2
命令"F:\WebApi\WebApi.nuget\nuget.exe"安装"F:\WebApi\WebApi\src\Sum.WebApi\packages.config"-source"-NonInteractive-RequireConsent-solutionDir"F:\WebApi master\WebApi master"退出,代码为216。
您肯定应该从Git中删除导致问题的已提交nuget.exe
。如果您配置自动程序包还原,效果会更好,这再次涉及删除nuget.exe文件:
https://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore
根据下面的MSDN线程,也可以通过修改.gitattribute
文件来修复它:
https://social.msdn.microsoft.com/Forums/en-US/b79c39b9-75d4-4c09-a774-f76474429c83/nugetexe-is-not-compatible-with-the-version-of-windows-youre-running?forum=TFService
但是,我仍然建议使用自动程序包恢复方法。