开发者

how to merge all web.configs at once for a mvc3 app

I've got a mvc3 a开发者_如何转开发pp with several configurations (debug, ci, qa, client-dev, client-qa, release). I've got web.configs merging nicely within visual studio for whatever configuration is currently selected in the ide.

So I've got this in my project.

web.config   
 -web.ci.config  
 -web.qa.config  
 - etc..  

I've also got the configs merging properly in cruise control. Unfortunately, I've got to build the entire product to get each config.

Here is what my cruise control config looks like for a single environment.

        <msbuild> 
            <executable>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
            <workingDirectory>C:\Projects\Source\foo.SwsFall2011</workingDirectory>
            <projectFile>msbuild.xml</projectFile>
            <buildArgs>/noconsolelogger /p:Configuration=Dev;DeployOnBuild=true;DeployTarget=Package;PackageAsSingleFile=false /v:d "/l:ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll;C:\Projects\Artifacts\foo.SwsFall2011\msbuild-results.xml" </buildArgs>
            <targets>BuildCI;ConfigMerge</targets>
            <timeout>600</timeout>
        </msbuild>

Is there a way just to merge the web.configs into a set of config directories with a single task that doesn't do the entire build? Something like:

configs  
 \dev\web.config  
 \qa\web.config  
 \client-dev\web.config  


The various web configs as per the functionality built in to visual studio only merge upon a publish. We have a post-build task to merge them upon build. Customize as you see fit. Realize the options are slim though - so don't shoot the messenger - this is just one way. There may be others, but nothing that I know of 'built in'

Visual studio 2010 - Per Developer/machine/environment Web.Config settings

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜