简体   繁体   English

MSBuild.exe不使用发布配置文件(pubxml)

[英]MSBuild.exe doesn't use publish profile (pubxml)

I have a website and a publish profile on TFS. 我在TFS上有一个网站和一个发布个人资料。 One all files are on build server, I execute the command below: 所有文件都在构建服务器上,我执行以下命令:

C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\MSbuild.exe /p:Configuration=Release /p:Platform=AnyCPU /p:DeployOnBuild=true /p:PublishProfile=my_publish_profile.pubxml /fl /flp:logfile=BuildOutput.log;verbosity=detailed "%WORKSPACE%\\my_project.csproj"

But msbuild.exe doesn't use the configuration I specified in that file. 但是msbuild.exe不使用我在该文件中指定的配置。 I wonder if I need to pass additional arguments. 我想知道是否需要传递其他参数。

尝试将完整路径放入pubxml文件。

This worked for me: 这为我工作:

C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\MSBuild.exe "D:\\Jenkins\\1.03 MckinseyBranch1 Minimal Deployment_Webdeploy\\workspace\\Mckinsey.sln" /tv:4.0 /p:Configuration=Release;DeployOnBuild=true;PublishProfile=test.pubxml; C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ MSBuild.exe“ D:\\ Jenkins \\ 1.03 MckinseyBranch1 Minimal Deployment_Webdeploy \\ workspace \\ Mckinsey.sln” /tv:4.0 / p:Configuration = Release; DeployOnBuild = true; PublishProfile = test.pubxml; VisualStudioVersion=12.0 VisualStudioVersion = 12.0

I noticed the settings in "PublishProfile" file are honored only when VisualStudioVersion=12.0 is used. 我注意到只有在使用VisualStudioVersion = 12.0时,才会遵守“ PublishProfile”文件中的设置。 It does not work for other values of VisualStudioVersion=12.0 . 它不适用于VisualStudioVersion = 12.0的其他值。 If VisualStudioVersion=10.0 is used, files are published at '(WebSite root)\\obj\\Release\\Package' 如果使用VisualStudioVersion = 10.0,则文件发布在'(WebSite根目录)\\ obj \\ Release \\ Package'

To use VisualStudioVersion=12.0 , you should have file "Microsoft.WebApplication.targets" at path "C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\WebApplications" 要使用VisualStudioVersion = 12.0 ,您应该在路径“ C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v12.0 \\ WebApplications”下具有文件“ Microsoft.WebApplication.targets”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM