TeamCity: How to inform MSBuild about accounting for publication profile settings?

I have a TeamCity build configuration with an MSBuild step when I would like to compile my project with a publish profile. My publishing profile is in MyProject \ Properties \ PublishProfiles \ profile.pubxml .

My .pubxml profile:

<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> 

My build step:

 Runner type: MSBuild Build file path: MyProject.csproj MSBuild version: Microsoft Build Tools 2013 MSBuild ToolsVersion: 12 Run platform: x86 

Now I would like to compile my project taking into account the parameters from my publication profile. I am trying to create all the parameters as system configuration parameters for the assembly (as TeamCity says, to use "Build Parameters" instead of "/ property:" in the MSBuild step. Does that mean? ), But I think that MSBuild does not take parameters into account, because I do not see project.dll in the bin file .. p>

+5
source share
1 answer

Add the TeamCity.PublishProfile property system and the value should be your pubxml profile name ("profile" in your example). Then add a build step that launches MSBuild with the target "WebPublish" - it works for me.

+4
source

Source: https://habr.com/ru/post/1204429/


All Articles