How am I supposed to deploy an ASP.NET 4 MVC website? - asp.net

What's the recommended way to deploy a website created with ASP.NET 4.0 and Visual Studio 2010?
I've previously always added a web setup project to my solution, and used that to create an MSI, even for small applications.
But when I build a web setup project in VS2010 it kind of works but some stuff still seems broken:
1. I need to turn on IIS 6 Compatibility on a Win 2008 R2 box to get the msi to run.
2. The msi includes web.config, web.debug.config, and web.release.config. I thought VS's web.config transformations was supposed to take care of that.
-Matt

I suggest looking at using MSDeploy, which packages up all your files and configuration settings into a zip file that can then be imported into IIS 7.
Scott Hanselman had a great presentation that shows how to use MSDeploy.

Related

ASP.NET MVC 6 using IIS to develop without publish

Is there any way to develop an ASP.NET MVC 6 beta 8 application on IIS without having the need to publish the application?
After install the httpPlatform module I am able to point IIS to a published application.
But how can yo point IIS to say your visual studio solution wwwroot so you can develop and see the changes you make without having the need to publish?
Is this no longer possible like how it you could develop asp.net MVC 5 apps?
For development is IIS Express and Kestrel the preferred way now?
Update:
I've tried to run both commands like the vs.net debugger shows but I still get bad gateway
You should read this.
I am currently using Visual Studio 2015 for developing MVC 6 (beta8) applications, and do not have the problem you describe. An MVC 6 application has a file that by default points to wwwroot folder (I do not remember now the filename), so you should not have problem in change code and hit F5 to see the changes, without publishing.
For anyone that is interested to get this working so that you have an edit and continue experience and don't have to manually build or publish your site and work against your source code:
https://github.com/tuespetre/dnx-watch-iis

Publish asp.net 3.5 website to local folder using MSBuild

I have a solution with multiple class libraries and a website (not a web application) in framework 3.5 VS 2008.
I would like to create a script/batch file to automate the publishing of the website to a given folder location(not to IIS).
I tried googling regarding this but everywhere they are refering to a .csproj file for the website. In my solution I do not have any such file for the website.
I do not want to use any add ons / other tools for automated builds right now.
Please suggest an approach using MSBuild or any other inbuilt asp.net tool.

Web Deployment tools for Visual Studio 2013

I am responsible for supporting a relatively complex Website project written with .NET 3.5.
Previously I was using Web Deployment Project with Visual Studio 2010 to deploy this website but at the moment I have only access to Visual Studio 2013.
As far as I know, there is no longer such a tool to be used for deployment in Visual Studio 2013 and I do want to compile the code before deploying to the production server. As mentioned earlier, the project is a bit complex and this would not be easy to be converted to a Web Application.
Any idea?
Unless I missed it, unsure what the issue is - in VS2013, Publish is what you are looking for (either WebSite or Application).
What exactly do you mean by "none of the (vs 2013 publish) options worked"? What is/was the issue?
In one of your comments, you state you want to "pre-compile" (aka "don't want to upload .cs source files) and that's a setting in Publish.
You can Publish to your local file system: "Custom" -> File System:
This extension still exists for Visual Studio 2013: http://www.iis.net/downloads/microsoft/web-deploy
Little bit confused with the question because you are keep referring about website rather web application.
If you are looking to convert web site to web app then you need to follow this: http://msdn.microsoft.com/en-us/library/vstudio/aa983476(v=vs.100).aspx
Otherwise, if you are referring about the deployment project. Yes, it is no longer available.
I'd a very similar situation like you and Since 2013 I have stopped using any deployment project, instead I have started using Publish that creates a deployment package for you on a Network , FTP, Local Drive or even on Azure.
Here is a nice guide from Microsoft
http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx
If you still want to go for Deployment Project, then you would need to go for "Installshield" limited edition,which is free (http://samirvaidya.blogspot.com.au/2013/11/how-to-enable-installshield-le-for.html).
http://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.110).aspx

how to Create Setup of Web application in asp.net?

How to Create Web Application Set up in asp.net ?
I have a web site in a Visual studio.I want to create a single web setup project which should install the web site.So how to create a single web setup project which supports multiple web application installation?
You can use Installshield to do that. When you go to add new project you will see that option under Other Project Types --> Setup and Deployment
http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visual-Studio?lang=1033&ver=prem
There are many 3rd party tools that can perform this for you (We use Anthill Pro to deploy between our various environments).
I've used the full version of InstallShield in the past but there was a bit of a learning curve to get it right.
The free alternative is to use the Web Setup Project template in Visual Studio (This uses the 'lite' version of InstallShield I believe). You can also check out this link, which describes many different options for you to deploy your website. Extract from the last link:
Visual Studio, ASP.NET, and IIS provide tools that can help you with
the process of deploying your web application or web site. Some of the
Visual Studio tools work only with web application projects, while
others work only with web site projects. (All MVC projects are web
application projects.)
Hopefully this walkthrough should provide you a good starting point should you choose to go down the Visual Studio route.

Can I use Web Config Transform when publishing to azure with Visual Studio 2012?

I have three enviroments for my asp .Net mvc application Local, Development and production. This means i need three webconfig files. The transformation seems to work fine with local and development deployment through a build server but not when deploying to production. It works when i manually publish the site from visual studio 2012.
Does it have something to do with the servicConfigurations for the different enviroments?
If you're going to Azure, then you can use publishing profiles. The trick is to chain your config files with your environment settings in Visual Studio.
There's an overview of publishing profiles here:
http://msdn.microsoft.com/en-us/library/ff398069.aspx
And Scott Hanselman walks through a number of scenarios with chained config files here:
http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
With those two pieces, there is enough info there to not only manually get the configs transforming, but also to work those into CI.
Hope this helps, cheers.

Resources