Publishing my asp.net mvc to IIS production server. should i have Visual Studio to do this - asp.net-mvc

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

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.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

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.

Related

C# MVC to IIS windows server 2008

I currently have a publish project from my local IIS which is windows 8 and already working but, my problem is I need to transfer it to our VM which is windows server 2008. I need some guidance or recommendation if I need to install Visual studio as well on the VM to publish it or is there any easy way that can simply copy the publish file from my local to VM windows server 2008.
You can publish from your project from local machine visual studio to remote server(in your case VM) if you have access to that server.
Alternatively manually publishing web project is just compiling in release mode with all dependencies & putting code in some IIS site/virtual directory with required Application pool settings.
Microsoft has very comprehensive documentation:
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/

How can I deploy an asp mvc app to a different computer using IIS

Is there a way to deploy my mvc web app to another computer (which will be used as a server).
Also, in the server, there is no Visual Studio installed, how can I deploy it there?
Check out those links below:
Access from another PC
Run project on another PC

How do I set the URL from localhost to localhost/applicationOne in Visual Studio?

I have a web application that at the moment is running on http://localhost if I use Visual Studio to run the solution.
I would like to change the settings so that VS starts running it on http://localhost/applicationOne as the starting point.
I want to replicate an issue that seems to be happening only if the web application is deployed to a directory that is not of the root directory in an IIS server.
How do I go about doing this?
You can edit the properties of the project, and set the Project Url.
If using Local IIS
Note: this will require Visual Studio to be run as an Administrator. Behind the scenes, a virtual directory will be created in IIS, and launching the project (e.g. via debugging with F5) will launch the browser, using the Url specified here.
If using IIS Express
Effectively the same settings apply with IIS Express. Note the port number in the Url.

Deploying MVC file system publish on IIS7

I have created an MVC application in Visual Studio 2013 and I now wish to deploy this on the IIS of the server so that all employees from within the company will be able to access it via their windows login credentials.
When I run this in localhost via Visual Studio debug it works as expected but I have been trying unsuccessfully to deploy this to a network server and I am unsure of the process and would be grateful for some clarification.
I chose a file system publish from the publish options but I am unsure as to how to get this accessible as an application. I have tried adding the files via the new website wizard and tried the url of 'holidays/' which I had entered but without success. I then tried to add the same virtual directory location as an application from within this website but again this was unsuccessful.
I use Web Deploy with VS. Your target server needs to also have Web Deploy:
Installing and Configuring Web Deploy on IIS 7
Once your target server is ready, you can deploy from VS. Here's a guide on doing that (you can jump right to "Publish to IIS" section if you like):
ASP.NET Web Deployment using Visual Studio
With Web Deploy, you can choose to publish directly or use a deployment package. Once you are happy the publishing works locally, you have a level of confidence your publishing will work in your Live environment.
I would suggest that before you publish direct to a live environment, that you test publish it to your local machine or a test environment that has the same IIS version, and .NET Framework installed.

Automatic Deployment of ASP.Net MVC using TFS2010 Beta2

i am building an Asp.NET MVC web site, and i want to make the deployment to IIS automatically as part of the build process, as indicated in the title, i am using vs2010 beta2 with tfs2010 beta2, and the dev server is running widows server 2008 service pack2, wich means IIS 7.
so can anyone provide with set-by-step way on how to do that, thanks
This doesn't cover anything specific for TFS, but it's a good start at setting up Web Deploy:
http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx

Resources