Note that there are some explanatory texts on larger screens.

plurals
  1. POIIS Express Child Application Config Inheritence
    primarykey
    data
    text
    <p>I'm trying to get an MVC3 application with a WCF service as a child application working as expected in IIS Express. It works fine in IIS but is doing something strange in IIS Express.</p> <p>When I run the site in IIS the config settings from both the child and parent applications are available within the child application. However, when I run the same code in IIS Express only the parent config settings are available.</p> <p>I can't find any documentation on this being an expected behavior. That doesn't rule it out but I'm inclined to suspect I have a configuration issue.</p> <p><strong>The question is, how can I run these sites in IIS Express without losing the settings applied in the child application?</strong></p> <p><em>I'm using a Windows 7 box with Visual Studio 2010, MVC3 and IIS Express 8.</em></p> <p>Here is the site configuration in my applicationhost.config file.</p> <pre><code>&lt;site name="ParentMvcApp" id="7"&gt; &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt; &lt;virtualDirectory path="/" physicalPath="c:\users\&lt;username&gt;\documents\visual studio 2010\Projects\ChildAppTest\ParentMvcApp" /&gt; &lt;/application&gt; &lt;application path="/Services/ChildWcfApp" applicationPool="Clr4IntegratedAppPool"&gt; &lt;virtualDirectory path="/" physicalPath="c:\users\&lt;username&gt;\documents\visual studio 2010\Projects\ChildAppTest\ChildWcfApp" /&gt; &lt;/application&gt; &lt;bindings&gt; &lt;binding protocol="http" bindingInformation="*:33888:localhost" /&gt; &lt;/bindings&gt; &lt;/site&gt; </code></pre> <p>Here is the MVC config file contents. </p> <pre><code>&lt;configuration&gt; &lt;appSettings&gt; &lt;add key="webpages:Version" value="1.0.0.0"/&gt; &lt;add key="ClientValidationEnabled" value="true"/&gt; &lt;add key="UnobtrusiveJavaScriptEnabled" value="true"/&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt; &lt;/authentication&gt; &lt;pages&gt; &lt;namespaces&gt; &lt;add namespace="System.Web.Helpers" /&gt; &lt;add namespace="System.Web.Mvc" /&gt; &lt;add namespace="System.Web.Mvc.Ajax" /&gt; &lt;add namespace="System.Web.Mvc.Html" /&gt; &lt;add namespace="System.Web.Routing" /&gt; &lt;add namespace="System.Web.WebPages"/&gt; &lt;/namespaces&gt; &lt;/pages&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;validation validateIntegratedModeConfiguration="false"/&gt; &lt;modules runAllManagedModulesForAllRequests="true"/&gt; &lt;/system.webServer&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt; &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="BasicHttpBinding_IService1" /&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://localhost:33888/Services/ChildWcfApp/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" /&gt; &lt;/client&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre> <p>Here is the WCF service config file contents.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="Test" value="Wtf"/&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true"/&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload