Tuesday, April 23, 2013

How to host a Nest ASP.Net applicaiton within the same source code.

I encounter an issue when i try to use the same source code to create a sub web application under

the current web application. the following picture will show the scenario that i want to acomplish






then i will receive the follow 500 Error




after i google  the web and do some research the following will solve the issue

this link will provide me great help in solving my problem

http://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic

I must stop the nested child application inherit System.Web and System.WebServer configuration from the parent which is the source.

<location path="." inheritInChildApplications="false">
  <system.web>
   <compilation debug="true" targetFramework="4.5"/>
   <httpRuntime targetFramework="4.5"/>
   <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
    <controls>
     <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
    </controls>
   </pages>
   <httpHandlers>
    <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
   </httpHandlers>
   <httpModules>
    <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
   </httpModules>
   <!--<httpRuntime maxRequestLength="92160000" executionTimeout="112"/>-->
   <identity impersonate="false"/>
  </system.web>
 
  <system.webServer>
   <validation validateIntegratedModeConfiguration="false"/>
   <modules runAllManagedModulesForAllRequests="true">
    <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
   </modules>
   <handlers>
    <remove name="Telerik.Web.UI.WebResource.axd" />
    <add name="Telerik.Web.UI.WebResource.axd" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode"/>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
    <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
   </handlers>
   <security>
    <requestFiltering>
     <requestLimits maxAllowedContentLength="943718"/>
    </requestFiltering>
   </security>
   </system.webServer>
 </location>