开发者

Emulating Visual Studio's Web Application "publish" at the command line

开发者 https://www.devze.com 2023-02-14 19:28 出处:网络
I am trying to automate my deployment process and am now thoroughly confused. I know that there are many questions on stackoverflow about this, but they all have different solutions and none of them w

I am trying to automate my deployment process and am now thoroughly confused. I know that there are many questions on stackoverflow about this, but they all have different solutions and none of them work.

I have a Web Application project which I usually publish by right-clicking and selecting "Publish". I get a dialog box where I use the following options:

  • Build configuration: Release
  • Publish method: File system
  • Target location: C:\Deployments\MyWebsite
  • Replace matching files with local copies

I should mention that in the properties of the project I have "Items to deploy" set to "Only files nee开发者_运维技巧ded to run this application".

After running this, my entire solution is built, dependencies are resolved, build events are run, web.config transformations are applied and the website is copied to C:\Deployments\MyWebsite, although non-required files such as code-behind files are not copied.

I have not been able to replicate this... in fact at this stage I'm not even sure which command line tool am I supposed to be using - msbuild, msdeploy or aspnet_compiler?

This guy asks almost the same question but his solution doesn't work at all. For example, build events do not run correctly because the macros are not resolved. Whats more, the files do not get copied into the correct directory at all... I can't even begin to explain what happens!


You may want to take a look at this framework, http://www.iis.net/download/webdeploy, for deployment, personally we use a msbuild task as part of CI build to build structure, remove unwanted files and deploy them, works well.

On seperate not, there is a very good podcast on Hansel Minutes on continuious deployment,

http://www.hanselminutes.com/default.aspx?showID=248

Also this Sayed Ibrahim Hashimi also blogs alot on mdbuild and msdeploy, you may find helpfull

http://sedodream.com/CategoryView,category,WebPublishingPipeline.aspx

Hope this helps.

Iain

0

精彩评论

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