2
votes

I have moved my asp.net mvc web application to our staging server and I have deploy it to IIS using visual Studio, as our staging server already contain Visual Studio .i did this bu right-click on my project and click on Publish. currently I need to move the asp.net mvc web application to production server and deploy it on IIS, but I have a couple of questions:-

  • Should I install visual studio inside my production server. Or it is better to avoid doing so ?
  • Is there a way to deploy my asp.net mvc directly to IIS , without uisng visual Studio ?

Thanks

3

3 Answers

2
votes

Should I install visual studio inside my production server. Or it is better to avoid doing so ?

While you technically could, you shouldn't. There's no reason why you'd like to install visual studio on your production server since you'd only use VS to debug existing projects, however, your website should not be running in Debug Mode and it is a waste of resources to run a production website in Debug Mode. You should have your website pre-compiled and deployed in Release Mode. That said, an installation of VS will serve no purpose on a production server

Is there a way to deploy my asp.net mvc directly to IIS , without uisng visual Studio ?

Definitely, you can publish your pre-compiled website to a location in your hard-drive or even to a remote location and then manually copy the website files to your production server. That is the hard way. But, if you have Build management tool such as TeamCity integrated with source control system...then this task becomes even simpler since you can even publish projects automatically

1
votes

1.bad idea. production server should have only your app code + advanced log system(nlog, etc) . nothing else.

2.

options:

xcopy deployment Compile your asp.net application and copy all the files to your server. You can do this by using FTP or shared directories. (Or anything else to transfer files.)

WebDeploy You have the possibility to deploy your asp.net webpage directly form your Visual Studio. If you go to "Build" and you choose "Publish Web". To be able to to do this you have to configure your server before. But this works automatically after you have set up everything. It's very handy since your deployment becomes easy to rebuild. http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx

Web Setup - Installer Visual Studio provide also the option to build an installer. This works like installing usual software on your windows computer with the installer wizard. (See the link) http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx

Manage multiple server There is also a way of managing the deployment of multiple servers. It seems to be a bit more complicated but could be interesting for professionals. (Check out on Google Microsoft Web Farm Framework 2.0

from here : Types of deployment in asp.net

0
votes

Should I install visual studio inside my production server. Or it is better to avoid doing so ?

Do not install VS on production servers. It is a bad practise.

Is there a way to deploy my asp.net mvc directly to IIS , without uisng visual Studio ?

You can use your local Visual Studio to publish bits to remote IIS - Automated Web Deploy using Visual Studio

Alternatively you can have new deployment strategies like let Team Foundation Server (TFS) deploy to IIS

One more option to is to FTP into Remote Web Server and push the latest bits from client side itself. I mean to ay, publish your site locally onto your file system. Then FTP into remote site using any FTP client like FileZilla. Then push the bits. For this to work, you need to configure remote server for FTP.