我已尝试按照http://docs.virtocommerce.com/display/vc1devguide/Source+Code+Azure+Deployment中提供的步骤将virtocommerce部署到azure,但我在构建过程中遇到了一些错误......
MSBUILD 4.0 Path = C:\Windows\Microsoft.NET\Framework\v4.0.30319\
03/03/2015 17:21:12 - Solution Build: In progress
Version: 1.0.62.1721
Microsoft (R) Build Engine version 4.0.30319.33440
[Microsoft .NET Framework, version 4.0.30319.34014]
Build build 03/03/2015 17:21:12。
1>Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" on node 1 (clean target(s)).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
ValidateProjects:
The project "Performance.FunctionalTests" is not selected for building in solution configuration "Release|Any CPU".
The target "MSDeployPublish" listed in a BeforeTargets attribute at "C:\code\github\VirtoCommerceCommunity\vc-community-master\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.wap.targets (89,11)" does not exist in the project, and will be ignored.
The target "MSDeployPublish" listed in an AfterTargets attribute at "C:\code\github\VirtoCommerceCommunity\vc-community-master\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.wap.targets (156,11)" does not exist in the project, and will be ignored.
1>Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (1) is building "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureScheduler.ccproj" (61) on node 7 (Clean target(s)).
C:\ code \ github \ VirtoCommerceCommunity \ vc-community-master \ src \ Azure \ WorkerRoles \ Scheduler \ AzureScheduler \ AzureScheduler.ccproj(68,3):错误MSB4019:导入的项目“C:\ Program Files( x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Windows Azure Tools \ 2.4 \ Microsoft.WindowsAzure.targets“找不到。确认声明中的路径是否正确,以及该文件是否存在于磁盘上。
61>Done Building Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureScheduler.ccproj" (Clean target(s)) -- FAILED.
1>Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (1) is building "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\CommerceSite.ccproj" (62) on node 2 (Clean target(s)).
62>C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\CommerceSite.ccproj(71,3): error MSB4019: The imported project "**C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets**" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
62>Done Building Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\CommerceSite.ccproj" (Clean target(s)) -- FAILED.
1>Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (1) is building "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ElasticSearch.ccproj" (66) on node 6 (Clean target(s)).
66>C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ElasticSearch.ccproj(70,3): error MSB4019: The imported project "**C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets**" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
66>Done Building Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ElasticSearch.ccproj" (Clean target(s)) -- FAILED.
1>Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (1) is building "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Extensions\Jobs\SchedulerConsole\SchedulerConsole.csproj" (69) on node 1 (Clean target(s)).
69>C:\code\github\VirtoCommerceCommunity\vc-community-master\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.console.targets(25,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. [C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Extensions\Jobs\SchedulerConsole\SchedulerConsole.csproj]
69>Done Building Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Extensions\Jobs\SchedulerConsole\SchedulerConsole.csproj" (Clean target(s)) -- FAILED.
1>Done Building Project "C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (clean target(s)) -- FAILED.
Build FAILED.
"C:\code\github\VirtoCommerceCommunity\vc-community-master\VirtoCommerce.sln" (clean target) (1) ->
"C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureScheduler.ccproj" (Clean target) (61) ->
C:\code\github\VirtoCommerceCommunity\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureScheduler.ccproj(68,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Windows Azure Tools\2.4\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
... 构建失败
At C:\code\github\VirtoCommerceCommunity\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-deploy.ps1:445 char:11
+ throw "Build Failed"
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Build Failed:String) [], RuntimeException
+ FullyQualifiedErrorId : Build Failed
我尝试使用Visual Studio 2013从不同的计算机(Windows 8.1和Windows Server 2012)中找到相同的错误... 有趣的是,在两台机器上目录C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Windows Azure Tools不存在... Azure工具仅存在于\ VisualStuion \ v12.0目录...
我们怎么解决这个问题?
提前致谢!
答案 0 :(得分:0)
问题似乎与msbuild如何与VS.NET 2013(http://blog.maskalik.com/msbuild/2014/03/04/changes-in-msbuild-with-visual-studio-2013/)打包在一起。为了使PowerShell部署开箱即用,需要安装VS.NET 2012。解决方法是将azure-deploy.ps1修改为从VS.NET 2013而不是.NET SDK指向MSBuild。
因此从
更改第426行$global:buildexe_path = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" -Name MSBuildToolsPath).MSBuildToolsPath
到(简单地改为4.0到12.0)
$global:buildexe_path = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" -Name MSBuildToolsPath).MSBuildToolsPath
一旦通过CI,它将被包含在下一个补丁中。