1

我尝试按照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]

构建开始于 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 工具不存在... Azure 工具仅存在于 \VisualStuion\v12.0 目录...

我们怎么能解决这个问题?

提前致谢!

4

1 回答 1

0

这个问题似乎与 msbuild 如何与 VS.NET 2013 打包有关(http://blog.maskalik.com/msbuild/2014/03/04/changes-in-msbuild-with-visual-studio-2013/)。为了使 powershell deploy 开箱即用,需要安装 VS.NET 2012。解决方法是修改 azure-deploy.ps1 以指向 VS.NET 2013 中的 MSBuild,而不是 .NET SDK。

所以将第 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,它将包含在下一个补丁中。

于 2015-03-04T02:00:14.307 回答