我正在通过命令行而不是在 Visual Studio 2013 中构建一个项目。请注意,我已将我的项目从 Visual Studio 2012 升级到 2013。该项目在 IDE 中构建良好。另外,我先完全卸载了VS2012,重新启动,安装了VS2013。我拥有的唯一 Visual Studio 版本是 2013 Ultimate。
ValidateProjects:
39>path_to_project.csproj(245,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
39>Done Building Project "path_to_project.csproj" (Clean target(s)) -- FAILED.
这是有问题的两行:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
原来的第二行是 v10.0,但我手动将其更改为 v12.0。
$(VSToolsPath) 从我看到的 v11.0 (VS2012) 文件夹中拉长,这显然不再存在。路径应该是 v12.0。
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\
我尝试在我的系统环境变量表中指定 VSToolsPath,但外部构建实用程序仍使用 v11.0。我尝试通过注册表搜索,但什么也没找到。
可悲的是,我没有看到任何简单的方法来获得使用的确切命令行。我使用构建工具。
想法?