Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Web Config Transform when publishing to azure with Visual Studio 2012?

I have three enviroments for my asp .Net mvc application Local, Development and production. This means i need three webconfig files. The transformation seems to work fine with local and development deployment through a build server but not when deploying to production. It works when i manually publish the site from visual studio 2012.

Does it have something to do with the servicConfigurations for the different enviroments?

like image 355
bassen Avatar asked Jan 09 '13 13:01

bassen


1 Answers

If you're going to Azure, then you can use publishing profiles. The trick is to chain your config files with your environment settings in Visual Studio.

There's an overview of publishing profiles here: http://msdn.microsoft.com/en-us/library/ff398069.aspx

And Scott Hanselman walks through a number of scenarios with chained config files here: http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx

With those two pieces, there is enough info there to not only manually get the configs transforming, but also to work those into CI.

Hope this helps, cheers.

like image 71
MisterJames Avatar answered Sep 20 '22 15:09

MisterJames