locked
Custom App Pool not working RRS feed

  • Question

  • By default all sites of the the same framework will use the same app pool definition from the applicationhost.config. I have 2 ASP .Net 4.6.2 web apps that require an environment variable to be set for a 3rd party process they both use, but I can't just set them globally as they need to be different. Our current solution is that we set them up in IIS then attach to the process when debugging. There is many more weird steps we have to take and troubleshoot when things don't work that I've resolved by switching to IIS Express except for 1. I can't get Visual Studio to honor the app pool setting in the applicationhost.config file

    <applicationPools>
    	<add name="TenantAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
    	<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
    	<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
    	<add name="Clr2IntegratedAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
    	<add name="Clr2ClassicAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" />
    	<add name="UnmanagedClassicAppPool" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" />
    	<applicationPoolDefaults managedRuntimeVersion="v4.0">
    		<processModel loadUserProfile="true" setProfileEnvironment="false" />
    	</applicationPoolDefaults>
    </applicationPools>


    <site name="Tenant" id="2">
        <application path="/" applicationPool="TenantAppPool">
            <virtualDirectory path="/" physicalPath="[full physical path]" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:54399:localhost" />
        </bindings>
    </site>

    However when I start debugging I get a refused connection response and the command line column in task manager shows the following

    "C:\Program Files (x86)\IIS Express\iisexpress.exe"  /config:"[correct path to applicationhost.config]" /site:"Tenant" /apppool:"Clr4IntegratedAppPool"

    Is this a bug or am I missing a step to get Visual Studio to honor the applicationPool attribute in the applicationhost.config?

    Running Visual Studio Professional 2019 Version 16.7.5 latest update as of posting


    • Moved by CoolDadTx Friday, October 2, 2020 5:09 PM ASP.NET related
    • Edited by c0d3m0nky Thursday, October 8, 2020 3:51 PM Wrong forum
    Friday, October 2, 2020 4:00 PM

Answers

  • This question is related to ASP.NET and not C#. Please post questions related to ASP.NET in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by c0d3m0nky Thursday, October 8, 2020 3:51 PM
    Friday, October 2, 2020 5:08 PM

All replies

  • This question is related to ASP.NET and not C#. Please post questions related to ASP.NET in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by c0d3m0nky Thursday, October 8, 2020 3:51 PM
    Friday, October 2, 2020 5:08 PM
  • For anyone stumbling on this, here's a link to my post over on the ASP forums

    https://forums.asp.net/p/2171325/6320569.aspx?p=True&t=637377438413749292

    Thursday, October 8, 2020 3:53 PM