尝试在构建服务器上构建我的项目给出了以下错误:
Microsoft (R) Build Engine Version 4.0.30319.1
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.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.
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the …
Run Code Online (Sandbox Code Playgroud) 首先是一些背景.在2012年底,我们将vs2008解决方案迁移到了vs2010,但我们仍然以.NET 3.5为目标.(我只知道最新最好的!)
几周前,当人们开始收到这些错误时,我们对此设置没有任何问题:
"foo.csproj" (Rebuild target) (16:5) ->
C:\...\foo.csproj(142,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 declaration is correct, and that the file exists on disk.
Run Code Online (Sandbox Code Playgroud)
有趣的是,如果你查看项目文件,它引用v10是有道理的,因为我们不使用Visual Studio 2012.
这个错误立刻打击了我们几个人,甚至在几个月没有改变的旧代码分支上.
我怀疑一些更新被推到我们的机器上,这让事情变得混乱,但我不知道该怎么做.
短期的解决方案是安装VS 2012而不是使用它,但我希望有一些比这更清洁的东西.
.net asp.net visual-studio-2010 visual-studio-2008 visual-studio-2012
到目前为止,我可以使用命令行构建.NET 4.5.2
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild MySolution.sln
Run Code Online (Sandbox Code Playgroud)
我需要在计算机上安装的唯一内容是.NET Framework和Visual Studio 2010 shell.
现在我考虑升级到.NET 4.6.但是我找不到如何在没有Visual Studio的情况下构建解决方案的方法.
我不想安装Visual Studio 2015,因为它对于这个托管的虚拟机来说太大了.我希望一些MSBuild或Microsoft软件包安装就足够了.
我们最近将VS 2010和.NET 4应用程序升级到VS 2012和.NET 4.5.我们有一个构建脚本来在测试服务器上部署应用程序.我们有两个盒子 - 一个是带有VS 2012的Windows 8(全新安装),另一个是带有VS 2010和VS 2012(新安装)的Windows 7.
从Windows 8运行构建脚本时,框构建脚本运行良好,并将应用程序部署到测试服务器.但是当从Windows 7框中部署应用程序时,我收到以下错误:
"C:\ Achinth\Build\Work\build\qa1sb.proj"(DeployAll target)(1) - >"C:\ Achinth\Build\Work\App\App.csproj"(ResolveReferences; MsDeployPublish target)(2) - >(MSDeployPublish目标) - > C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5):错误:Web部署任务失败.( (8/19/2012 6:23:41 PM)在远程计算机上处理请求时发生错误.)[C:\ Achinth\Build\Work\App\App.csproj] C:\ Program Files(x86 )\ MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5):错误:\ r [C:\ Achinth\Build\Work\App\App.csproj] C:\程序文件(x86)\ MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5):错误:(8/19/2012 6:23:41 PM)发生错误时请求已在远程计算机上处理.\ r [C:\ Achinth\Build\Work\App\App.csproj] C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft. Web.Publishing.targets(3847,5):错误:应用程序池t 您尝试使用的帽子将'managedRuntimeVersion'属性设置为'v4.0'.此应用程序需要'v4.5'.[C:\ Achinth \建立\工作\软件\ App.csproj]
看看错误,看起来MSBuild正在使用VS 2010目标而不是VS 2012,这导致了错误.由于Windows 8机箱没有VS 2010,因此它正确使用VS 2012目标.
有人可以提供有关如何让MSBuild选择正确版本的指示吗?
我正在建立一个新的构建服务器,以支持我们的开发团队从VS2010迁移到VS2013.我们尚未迁移我们的TFS服务器,因此新的构建服务器已设置为带有2个代理的VS2010构建控制器.我还在机器上安装了VS2013(大锤方法).
我们所有的代码都已迁移到目标.Net 4.5.1并在开发人员的工作站上编译.
我们的大多数解决方案都很好,除了包含Web项目的解决方案 这些项目抱怨:
找不到导入的项目"C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets".
导入的项目通过以下两行在构建过程中使用VisualStudioVersion变量:
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
...
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
Run Code Online (Sandbox Code Playgroud)
根据这个页面:
http://msdn.microsoft.com/en-us/library/vstudio/bb383796.aspx
对于4.5和4.5.1目标,将设置为"11.0".但构建机器只有上述路径的12.0版本:
"C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets"
这些相同的.csproj线似乎在一个全新的VS2013项目中使用,所以我不确定它如何能够在构建机器上正确解析.
我在Team city中构建项目时遇到以下错误.
同一个项目正在本地机器上构建.本地机器有VS 2015和F#4.0.
我的项目配置如下.
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\4.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
Run Code Online (Sandbox Code Playgroud)
这是控制台应用程序.
我在我的服务器上安装了Visual Studio 2017来构建项目.服务器正在运行团队基础服务器2015 Update 3.TFS 2015在Visual Studio版本中显示最新选项,但是当我构建项目时,它不构建,并且代理没有Visualstudio,vstest,msbuild等功能.我正在尝试手动添加功能,但它不起作用,并说Visual Studio没有找到.