Pregunta

My work has some dedicated web servers (Server 2008R2, IIS7). Currently everything done here before has just been asp.net webforms. For a new project I want to finally introduce them to MVC. I have a vanilla MVC application created in VS2013. I walked through some different sites and got it set up on my local IIS (full, not express) just fine. I can hit 'localhost' and see the site I created. I am using web deploy, and it worked very well.

After that I moved on to our development server. I set it all up the same (i.e new website in iis, web deploy set up with proper credentials, etc). Publishing from VS works. On the development server I see all the files there, but in IIS on the server (via RDP session) I cannot browse to it. It does not give me a 404 or 503 error, internet explorer just tells me that it can't find the address.

Based off the many, many articles I went through I did the following:

  1. aspnet_regiis.exe -i (32 and 64 bit)
  2. Made sure the server has Web Deploy 3.5 and Web Deploy tools 2.1 installed.
  3. Added some lines to my web.config (see below)****.
  4. made sure the server had .net 4.5 and mvc installed.

After all that it still will not show me the site. Anything I am missing? I would love to find a tutorial to walk me through baby-step by baby-step, but all I see out there assumes that you already have x and y set up, or you already know IIS like the back of your hand.

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
  <remove name="UrlRoutingModule-4.0" />
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>

¿Fue útil?

Solución

To deploy MVC4 Application onto IIS 7.5

  1. Make sure that you installed the latest framework.
  2. Go to %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –ir for 32 bit or %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –ir for 64 to register asp.net
  3. To be able to work with sites in MVC for IIS7 ir IIS7.5 please update it (http://support.microsoft.com/kb/980368).(Good)
  4. Make sure that there is:

    <modules>
      <remove name="UrlRoutingModule-4.0" />
      <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" 
           preCondition="" />
      <!-- any other modules you want to run in MVC 
           e.g. FormsAuthentication, Roles etc. -->
    </modules>
    

in web.config. (Good)

  1. Make sure that there is

    <system.webServer>
      <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>
    

    in web.config.(Bad)

from own experience... use "Good"

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top