views:

51

answers:

1

HI there, I have a problem with my MVC 2 ASP.NET running on IIS 7.5

  Server Error in Application "ORDERS"Internet Information Services 7.5
    Error Summary
    HTTP Error 404.0 - Not Found
    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Detailed Error Information
    Module IIS Web Core 
    Notification MapRequestHandler 
    Handler StaticFile 
    Error Code 0x80070002 
    Requested URL http://localhost:8080/home 
    Physical Path C:\Ordering\home 
    Logon Method Anonymous 
    Logon User Anonymous 

I published it locally and then copied the files to the server and dropped them to c:\Ordering. When I try to run localhost:8080/home it cant be found!!

EDIT:

I have since found that this is a redirect issue - something isnt kicking in to redirect to /Home or /Account/LogOn

heres the web.config if it helps:

<?xml version="1.0"?>

<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|ASPNETDB.MDF;User Instance=true"
      providerName="System.Data.SqlClient" />
    <add name="orderbaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\orderbase.mdf;Integrated Security=True;User Instance=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>

    <customErrors mode="Off"/> 

    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>  


    <membership>
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>


    <roleManager enabled="true">
      <providers>
        <clear />
        <add connectionStringName="ApplicationServices" applicationName="/"
          name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
          type="System.Web.Security.WindowsTokenRoleProvider" />
      </providers>
    </roleManager>

    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Any help appreciated!

A: 

You should verify that you have the virtual derictory "home" in IIS manager with port 8080 which point to the C:\Ordering\home directory. If it is not yet exist - create it and convert it in the application (see context menu).

Verify that IIS_IUSRS group (or an account under which runs the application pool) has access to the directory C:\Ordering\home.

Oleg
ok, thanks, but when I run on my local IIS, the forwarding to /home or /account/logon is done automatically - i didnt add any virtual directories.
bergin
You should somewhere in ISS define, that it should waiting for requests to 8080 port and that if request come to http://localhost:8080/home it should search files like defaul.html, default.asp, default.aspx and so on(see standard documents configuration). It can be very much reasons of your error. It must be in the ISS configuration which you not post here.
Oleg
currently looking at: http://stackoverflow.com/questions/384184/asp-net-mvc-page-can-not-foundnot sure how to add the mapping to:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
bergin
how do i get the IIS config?
bergin
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/looking pretty good at the moment
bergin
... should have mentioned that this is a 64 bit environment. doh. trying to find out how to set .net to go to the correct framework
bergin
This happens because IIS 6 only invokes ASP.NET when it sees a “filename extension” in the URL that’s mapped to aspnet_isapi.dll (which is a C/C++ ISAPI filter responsible for invoking ASP.NET). Since routing is a .NET IHttpModule called UrlRoutingModule, it doesn’t get invoked unless ASP.NET itself gets invoked, which only happens when aspnet_isapi.dll gets invoked, which only happens when there’s a .aspx in the URL. So, no .aspx, no UrlRoutingModule, hence the 404. (from Steve Sanderson)
bergin
All the references wich you currently wrote are about old version of IIS (bofore 7.0), but you try to run it on ISS 7.5. It is really difficult to give some recommendation if you can non see the server. Another possible solution could be full deinstallation of ISS, deleteing of old configuration (you should stop some services before) and installing all one more time. Then try to install your ASP.NET application on a clear computer.
Oleg
well, from what ive read the redirection isnt working
bergin
on the 64 bit win 2008 server, .net 4.0 is not mentioned in the role services - just the 3.5.1 .net framework. Could this be why my MVC programs arent working on IIS 7.5 with the 404 /403 messages?
bergin
No. You see in features only components which are a part of operation system. .NET 4.0 is an add-on. If you can see it and choose in the configuration of the Application Pool, then you have it installed.
Oleg
ok good at least that rules that out
bergin