Creating Web Deploy package to set .net version and create new website
I'm starting to use web deploy to build and deploy a web application. So far I can build a package and deploy it, but it's not doing much more than a xcopy deployment would do.
so my command to build the package is this:
msbuild EMP.WebAdmin.csproj /T:Package /P:Configuration=Release;PackageLocation="D:\Packages\WebAdmin.zip";DeployIisAp开发者_运维知识库pPath="TestWebAdmin"
If the TestWebAdmin already exists and the version of .net has been set to .net 4 everything seem to be fine. However, what I'd really like to do is have the package check to see if the deployment already exists, if not create it (preferably in a defined directory) and to ensure that any host headers are set correctly. Am I asking too much of web deploy, I've not been able to find a good article which talks about how to go t this kind of detail.
Is what I'm trying to do possible?
What are the settings on your Publish / Package Website tab for the project? Your site needs to be using IIS, and you need to check the box to include IIS application settings. Also, how are you deploying? My understanding is that the msbuild command you're using will build the package, but where are you calling msdeploy?
I don't have msdeploy creating the application for me, but it's running Sql update scripts I'm also including.
You can call WebDeploy directly to create your package and set this as a post-build event:
"%ProgramFiles%\IIS\Microsoft Web Deploy\msdeploy.exe" -source:iisApp="<physical path to your app>" -dest:package=d:\myApp.zip
This way you dont have to have your app deployed to an IIS server, in fact you dont event need IIS installed on the box.
精彩评论