3
votes

I am running an TeamCity Build Server that builds and deploys a asp.net 4.0 application. I need to obfuscate the assemblies of prior to deployment. I have two build configurations. One is SVN triggered that compiles and packages. Packaging is done through: - Calling MSBuild with web project file as build file - using the following parameters: /T:Package

The second configuration is manually triggered and only does deployment. Again, it calls MSBuild and uses the following parameters:

/P:Configuration=%env.Configuration% /P:DeployOnBuild=False /P:DeployTarget=MSDeployPublish /P:MsDeployServiceUrl=https://%env.TargetServer%/MsDeploy.axd /P:AllowUntrustedCertificate=True /P:MSDeployPublishMethod=WMSvc /P:CreatePackageOnPublish=False /P:UserName=Administrator /P:Password=%env.DeployPassword%

As you can see, DeployOnBuild is set to false, as well as CreatePackageOnPublish. Still, when I run this build configuration, the assemblies are rebuilt.

I would like have a step prior to deployment that obfuscates the assemblies. And then have the deployment step simply deploy the obfuscated assemblies. How do I need to call MSuild in order for it to skip the compile step and move immeditely to publish?

Another that is manually triggered and only does deployment.

1

1 Answers

0
votes

The Package target is defined in the Microsoft.Web.Publishing.targets file. If you have a look in there you will see extensibility points.

This blog post on Extending the MSBuild Package target gives some examples.