asp.net - MSDeploy to multiple servers -
asp.net - MSDeploy to multiple servers -
i looking way deploy multiple different environments.
ie, dev, uat, prod1, , prod2 servers
i under impression msdeploy work this. have deploys using command
"c:\program files\iis\microsoft web deploy\msdeploy.exe" -verb:sync -source:contentpath="d:\sourcepath" -dest:contentpath="d:\destpath", computername=prodserver1 "c:\program files\iis\microsoft web deploy\msdeploy.exe" -verb:sync -source:contentpath="d:\sourcepath" -dest:contentpath="d:\destpath", computername=prodserver2
this work, in application i'm developing needs deploying has database connection involved, needs changed per environment.
<connectionstrings> <add name="devserver" connectionstring="data source=devserver\sqlinstance;initial catalog=dbname;user id=sqluser;password=sqlpassword" providername="system.data.sqlclient" /> </connectionstrings>
also, since wcf service have identity endpoint need changed per environment well
<identity> <dns value="devserver" /> </identity>
is there way parameterize this? should set multiple web.config files? easiest route go this?
assuming using visual studio 2010 or 2012, can set publish profile each environment , set database connection string in that, set web.config transform each publish profile create endpoint changes, , can deploy using msbuild command line instead of msdeploy directly.
for details on how set publish profiles, see http://msdn.microsoft.com/en-us/library/dd465337.aspx
for web.config transform examples, see http://www.asp.net/web-forms/tutorials/deployment/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-web-config-file-transformations-3-of-12
on publishing command line, format next publishing solution:
msbuild path\to\solution.sln /p:deployonbuild=true /p:publishprofile=[nameofprofile] /p:password=[password]
to publish project rather solution, specify .csproj/.vbproj file , add together /p:visualstudioversion=11.0 vs 2012 (10.0 vs 2010).
asp.net web-services configuration msdeploy
Comments
Post a Comment