0

如何解决 NuGet.targets 文件中的此错误:

 ?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

    <!-- Enable the restore command to run before builds -->
    <RestorePackages Condition="  '$(RestorePackages)' == '' ">false</RestorePackages>

RestorePackages 标记有一个错误,指出 msbuild/2003 具有无效的子元素。

我收到相同类型的标签错误:NuGetToolsPath、PackagesProjectConfig、NuGetExePath、MsBuild 和 DownloadNuGet

在这些错误之后,我在从 GitHub 下载的 MVCForum 软件的 VS2013 解决方案的 17 个项目中得到了 17 个“无法找到 .....nuget\NuGet.exe”的案例。

4

1 回答 1

0

单击 Build->Clean Solution 并右键单击该解决方案并设置为“启用 NuGet 包还原”。显然,这会导致获取 NuGet.exe 的正确副本。这样做之后,所有的错误都消失了。

于 2015-02-27T14:02:53.803 回答