[英]msbuild package target issue
I have an MVC 4 web app with VS2012, msbuild and am creating a build script with psake. 我有一个带有VS2012,msbuild的MVC 4 Web应用程序,并且正在使用psake创建一个构建脚本。 I've created a publish profile in VS that packages up the project into a zip file.
我已经在VS中创建了一个发布配置文件,将该项目打包为一个zip文件。 Running it from within VS works fine.
从VS中运行它可以正常工作。 However, running it from the command line, I get the following error:
但是,从命令行运行它,出现以下错误:
Executing package Microsoft (R) Build Engine version 4.0.30319.32559 [Microsoft .NET Framework, version 4.0.30319.32559] Copyright (C) Microsoft Corporation. 执行程序包Microsoft(R)Build Engine版本4.0.30319.32559 [Microsoft .NET Framework,版本4.0.30319.32559]版权所有(C)Microsoft Corporation。 All rights reserved.
版权所有。
C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v10.0\\Web\\Microsoft.Web.P ublishing.targets(2006,11): error MSB4100: Expected "$(_DeploymentUseIis)" to e valuate to a boolean instead of "", in condition "$(_DeploymentUseIis) And ($(L ocalIisVersion) >= '7')".
C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v10.0 \\ Web \\ Microsoft.Web.P ublishing.targets(2006,11):错误MSB4100:期望“ $ {_ DeploymentUseIis)”评估为在条件“ $(_ DeploymentUseIis)和($(L ocalIisVersion)> ='7')”中使用布尔值而不是“”。 C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudi o\\v10.0\\Web\\Microsoft.Web.Publishing.targets [E:\\bitbucket\\mypopsales\\src\\MyPop Sales\\ConsumerWeb\\ConsumerWeb.csproj] Error: 07/25/2013 07:29:41: At E:\\bitbucket\\mypopsales\\tools\\psake\\psake.psm1:139 char:9 +
C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudi o \\ v10.0 \\ Web \\ Microsoft.Web.Publishing.targets [E:\\ bitbucket \\ mypopsales \\ src \\ MyPop Sales \\ ConsumerWeb \\ ConsumerWeb.csproj]错误: 2013年7月25日07:29:41:在E:\\ bitbucket \\ mypopsales \\ tools \\ psake \\ psake.psm1:139 char:9 +
throw (" Exec: " + $errorMessage) +throw(“执行:” + $ errorMessage)+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [<<==>>] Ex ception: Exec: Error executing command msbuild $csprojFile /t:Package /p:Plat form=AnyCPU /p:Configuration=$config /v:q .~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [<< == >>]接收:执行:执行命令msbuild $时出错csprojFile / t:Package / p:Platform = AnyCPU / p:Configuration = $ config / v:q。 ERROR: 1
错误:1
I have Web Deploy 3.5 installed on the box via WebPI. 我通过WebPI在盒子上安装了Web Deploy 3.5。 Any idea on how I can resolve this issue?
关于如何解决此问题的任何想法吗? The relevant section of the build script is as follows:
构建脚本的相关部分如下:
task package -depends test {
$csprojFile = "$solution_dir\$consumer\$consumer.csproj";
exec{ msbuild $csprojFile /t:Package /p:Platform=AnyCPU /p:Configuration=$config /v:q }
}
Joy...after spending a couple of hours on this, it turns out to be as simple as adding: 欢乐...花了几个小时之后,事实证明它很简单:
/p:VisualStudioVersion=11.0 /p:VisualStudioVersion=11.0
to the parameters list. 到参数列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.