-->

How to deploy mvc 3 /4 using vs2012

2020-07-22 19:43发布

问题:

First of all, i tried searching the web n how to do this but all of them did not work for me. Also tried the web deploy, web deploy package and file system.

What I want, if you guys may, is a simple step by step guide and the requirements of deploying a web project.

I have now a newly installed win7 (virtual machine) where I tried all of the tutorials i can find on web.

Please give me the most straightforward and easy to understand way to deploy an MVC 3 app. Also do i need to add / configure IIS7?

project: mvc & mvc4 OS: win7 32 bit SQL server 2008

thank you :-)

回答1:

  1. Install IIS 7
  2. Ensure that IIS 7 can process ASP.NET requests. A tutorial can be found here.
  3. Now you have two options:

    3.1 Install ASP.NET MVC on your machine. This will install the ASP.NET MVC DLL's in your machine's GAC. This is the most simple solution.

    3.2 Setup your MVC application for a so-called bin deploy. This will ensure that when you publish your application, the ASP.NET MVC DLL's will also be copied to the output directory. You can find a tutorial here.

  4. Deploy your ASP.NET MVC applicaton.

Your app should now be up and running! If your app still doesn't work, I suggest checking this troubleshoot guide: http://blogs.msdn.com/b/rickandy/archive/2011/04/22/test-you-asp-net-mvc-or-webforms-application-on-iis-7-in-30-seconds.aspx