Deploying ASP.NET MVC as a distribution

I have an ASP.NET MVC application. And I need a way to deploy it.

BUT

I donโ€™t just need to copy it to my own web server. It should not be a website accessible on the Internet. Not.

Instead, I need my users to be able to install it on their own server. What may or may not be visible from the Internet.

That is, I need to create an MSI package (or a self-extracting EXE installer or something else) that my client can just double-click, and the MVC application should be installed on the local IIS.

I can, of course, just write code that will extract the files, copy them to the local hard drive, and then create a website or virtual directory in IIS, blah blah blah. But something tells me that there should be an easier way. For example, a WiX extension that already does this. Or something.

Note. the application is very simple. No need for databases, special privileges, SMTP server configuration ... Or, in fact, any configuration at all. Just copy the files and create the IIS application.

+8
c # asp.net-mvc
source share
4 answers

This may require some encoding, but (if you need a pretty presentable interface), there is a feature in the Visual Studio build deployment package.

Build delpoyment package

Where he will build you a package that your client can run to create all the necessary things in IIS, so IIS settings are also applied. Scott Hanselman has a series of posts about this. You can change the default settings from the package / publish settings.

package / publish settings . To deploy packages, you must have msdeploy.exe . You can send a mail folder and when your clients launched the .cmd file, they will be up and running as soon as possible. However, if you want to put beautiful bows in a package, you can run it from a C # application and you need some encoding, but I'm sure it won't take more than 15 minutes.

 Usage: -------------------------- {0} [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...] 

All you have to do is

 System.Diagnostics.Process proc = new System.Diagnostics.Process(); const string filename = @"/*some file location*/"; proc.StartInfo.FileName = filename; proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); 
+6
source share
+1
source share

Whenever I am faced with the need for complex installation, I always turn to WiX.

You can use WiX to install your MVC-based website, and then use the IIS extension ( http://wix.sourceforge.net/manual-wix3/iis_xsd_index.htm ) to create a new application pool and a site to launch it.

A few questions I might think about that you might want to study in more depth:

  • What if the user does not install IIS?
  • What if they do not have the installed MVC Tools package (is it a bundle or not)?

In addition to those points that, in my opinion, WiX + IISExtension will easily cover your core, copy files and create website requirements.

+1
source share

Visual Studio has web configuration projects that you can use, although I believe that various types of deployment projects stop at some point in favor of WiX.

I donโ€™t know much about WiX, but I would definitely look at this before I see if it will do what you want. I assume that I will get a WiX package that delivered the files to where the user asked them, and then ran a PowerShell script (deployed in the package) to configure IIS, etc. As needed.

0
source share

All Articles