当我想使用发布配置文件编译我的项目时,我使用 MSBuild 步骤进行 TeamCity 构建配置。我的发布配置文件位于MyProject\Properties\PublishProfiles\profile.pubxml.
我的配置文件.pubxml:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>
<DebugSymbols>False</DebugSymbols>
<WDPMergeOption>MergeAllOutputsToASingleAssembly</WDPMergeOption>
<UseMerge>True</UseMerge>
<SingleAssemblyName>project</SingleAssemblyName>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\DevelopmentFolder</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
我的构建步骤:
Runner type: MSBuild
Build file path: MyProject.csproj
MSBuild version: Microsoft Build Tools 2013
MSBuild ToolsVersion: 12
Run platform: x86
现在我想使用我的发布配置文件中的参数来编译我的项目。我尝试将所有参数创建为构建配置的系统参数(如TeamCity 表示在 MSBuild 步骤中使用“构建参数”而不是“/property:”。这意味着什么? https://stackoverflow.com/questions/6218486/teamcity-says-to-use-build-parameters-instead-of-property-in-an-msbuild-st),但我认为 MSBuild 没有考虑参数,因为我看不到bin目录项目.dll file.
添加 TeamCity 属性 system.PublishProfile ,该值应该是您的 pubxml 配置文件名称(示例中的“profile”)。然后添加一个构建步骤,该步骤以目标“WebPublish”运行 MSBuild - 它对我有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)