SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Utilizing MVC3 project as an application inside another virtual directory

    I have posted the mvc3 site to test server -- IIS7. It is showing up just fine with test url. This site utilizes windows authentication.

    We are migrating our classic asp site to mvc (windows authentication). For now we need to set this mvc site as an application inside the classic asp site. For this, i have created an application "NetSite" that uses the same app pool and working directory as above direct link. When i use http://classicasp.domina.com/NetSite, i get 403 error. When i use http://classicasp.domain.com/NetSite/Home/Index, i get 404 error.

    When i test the mvc site directly with http://nettest.domain.com/, /home/index page shows up just fine.

    I have checked application "NetSite", under classic asp virtual directory and it has "windows authentication" enabled.

    Here is my current web.config:

    HTML Code:
    <?xml version="1.0"?>
    <!--
     For more information on how to configure your ASP.NET application, please visit
     http://go.microsoft.com/fwlink/?LinkId=152368
     -->
    <configuration>
      <configSections>
        <!-- required to read the <dataCacheClient> element -->
        <sectionGroup name="elmah">
          <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
          <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
          <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
          <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
        </sectionGroup>
      </configSections>
    
      <location path="." inheritInChildApplications="false">
        <connectionStrings>
          
        </connectionStrings>
        <appSettings>
          <add key="webpages:Version" value="1.0.0.0" />
          <add key="ClientValidationEnabled" value="true"/>
          <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
        </appSettings>
        <system.web>
          <customErrors mode="RemoteOnly" defaultRedirect="~/Message/Index?title=ErrorProcessingRequest">
            <error statusCode="403" redirect="~/Message/Index?title=ErrorProcessingRequest" />
            <error statusCode="404" redirect="~/Message/PageNotFound" />
          </customErrors>
          <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.Helpers, Version=1.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=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
              <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            </assemblies>
          </compilation>
          <authentication mode="Windows">
          </authentication>
          <authorization>
            <deny users="?" />
          </authorization>
    
          <pages>
            <namespaces>
              <add namespace="System.Web.Helpers" />
              <add namespace="System.Web.Mvc" />
              <add namespace="System.Web.Mvc.Ajax" />
              <add namespace="System.Web.Mvc.Html" />
              <add namespace="System.Web.Routing" />
              <add namespace="System.Web.WebPages"/>
    
            </namespaces>
          </pages>
          <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
            <add name="FixIIS5xWildcardMapping" type="Elmah.FixIIS5xWildcardMappingModule, Elmah" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
          </httpModules>
          <httpHandlers>
            <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
          </httpHandlers>
        </system.web>
        <system.webServer>
          <validation validateIntegratedModeConfiguration="false"/>
          <!-- Must be true for windows authentication -->
          <modules runAllManagedModulesForAllRequests="true">
            <remove name="XHtmlModule" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="integratedMode" />
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="integratedMode" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="integratedMode" />
          </modules>
          <handlers>
            <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
          </handlers>
        </system.webServer>
      </location>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <elmah>
        <security allowRemoteAccess="1"></security>
    
        <errorMail from="abc@test.org" to="abc@test.org" subject="ERROR (Dev)" async="true" smtpPort="00" smtpServer="fs.test.org" userName="userName" password="password" />
    
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/ElmahLogs" />
        <errorFilter>
          <test>
            <and>
              <equal binding="HttpStatusCode" value="404" type="Int32" />
              <regex binding="Context.Request.ServerVariables['URL']" pattern="/favicon\.ico(\z|\?)" />
            </and>
          </test>
        </errorFilter>
      </elmah>
      <system.net>
        <mailSettings>
          <smtp deliveryMethod="network">
            <network host="fs.test.org" port="00" userName="userName" password="password" />
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>
    Thanks.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for /NetSite, on 403 error page i have this:
    Logon Method: [TD]Anonymous[/TD]

    [TR]
    Logon User: [TD]Anonymous


    But for Netsite application "Windows Authentication" is enabled. What else do i need to check here?[/TD]
    [/TR]
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •