tags:

views:

373

answers:

7
+3  Q: 

ASP.NET Deployment

For the last couple of months I have been writing an intranet site for my college with lots of reports for staff about students. It is all going well but once a week (ish) I am having to go to IT get them to log into IIS stop the application pool, clear out the website folder, clear out the temporary asp.NET cache and replace the website with the new one. Not a big job but I would prefer to do it myself as and when I want.

I don't know much about ASP.NET deployment and IIS is there a way for me to update the website myself (keeping the system live if possible)? Last time I looked at this I think I found the files were locked within the website directory.

What do the different publish options achieve?

A: 

I always update my website during scheduled maintenance, usually outside work hours. So, evening or weekend are the best time to shutdown for a short laps of time the services, and update the website. Schedule that maintenance so everyone know their will be a downtime.

David
The question is not when, but what is the easiest and least painful method.
Geoff
+1  A: 

You could activate the Frontpage-Extensions for this web in IIS. They handle the whole deployment and updating. We have them activated for every website for easy maintain.

Visual Studio can connect and deploy directly to Frontpage-Extension enabled websites, so there should be no problem.

Anheledir
+2  A: 

Actually, I work with 2 forms:

1) Publish form VS to a local directory and then upload (via ftp) to server. I`m doing this way to use filezilla ftp client and do not transfer web.config file.

2) Precompile website (from ccnet), zip it, transfer to server, connect at server (Remote desktop) and execute a .bat file, that put application in offline mode (App_Offline.htm), backup it, and unzip new version. Ws are planing to create a second website to admin that avoind to manually connect and execute .bat.

Zote
A: 

You can use a program like Beyond Compare to connect to your server's FTP (which you can point to the website folder) and upload the new files. You can compare your files, see a line by line comparison, and upload only changed files. Works pretty well for me.

Arthur Chaparyan
+1  A: 

You can just overwrite the files that exist if you are going that route. Personally I have Cruise Control.NET for my deployment and I love it. I have subversion setup so our development and staging systems are automatically updated with each commit to svn. Then for live I tag whatever I need to and change the config to pull from that new tag for the Live site and force a build on it. It works really well you should check it out. It also compiles your .cs files and doesn't deploy if your code doesn't build. I believe Jeff is using it with stackoverflow.

Greg
A: 

To install an ASP.net application on our IIS server (without needing Visual Studio), we checkout the project code from version control then run msbuild.exe on the project file. You can find msbuild.exe in the .Net framework folder, eg:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\

The only thing we had to do was copy across the target definitions from one of the development machines, which are usually stored in:

C:\Program Files\MSBuild\

It's safe to leave the .csproj/.vbproj files in the web folder as IIS won't serve them up as there will be no MIME type defined for them on that machine, but you can delete them if you like.

This setup is easily scriptable too, which is a bonus.

X-Cubed
+1  A: 

Why are you stopping the app pool and clearing the temp files? It works just fine of you overwrite the files in the website itself.

The only thing I do is go into the bin directory and clear out all the randomly named .dll files.

Visual Studio also has it's own deployment option, which you can just give a UNC path and it will delete the old files and copy up the new version of the site. It even throws up an app_offline.html for you.

Telos
The web config kept being locked which was confusing me since I am no longer adding anything to it very often I am able to do a direct replace.
PeteT