Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why an IIS 10 Application pool is created when I start debug through Visual Studio 2017 (15.7.3)?

EDIT 1 : I experience the same issue with ASP NET Core 2.0 apps using the same configuration, so this rule out the framework himself. Next potential culprits : the .NET Core 2.1 SDK (v2.1.300) or a bad Visual Studio update (15.7.3).


I have a strange issue with IIS 10 and ASP NET Core 2.1.0 when I debug my API.

I had a IIS Website "api.local" with an ASP NET Core 2.0 application "v1" inside it.

The "v1" application is configured to use the "api.local" Application Pool generated when I created the Website. This Application Pool is configured as follow :

  • .Net CLR Version : No Managed Code
  • Managed Pipeline Mode : Integrated
  • Identity : ApplicationPoolIdentity

In order to debug in Visual Studio 2017 (15.7.3), I use the following launchSettings.json

{
    "iisSettings": {
        "windowsAuthentication": false,
        "anonymousAuthentication": true,
        "iis": {
            "applicationUrl": "https://api.local/v1",
            "sslPort": 0
        }
    },
    "profiles": {
        "IIS": {
            "commandName": "IIS",
            "environmentVariables": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            },
            "launchBrowser": true,
            "launchUrl": "graphiql/"
        }
   } 
}

And everything worked fine.


Now, each time I start debugging, a new IIS Application pool is created called "v1 AppPool" (and then "v1 AppPool 2" and so on) and the "v1" Website configuration change to use this newly created IIS Applicataion pool.

I am not sure since when but I think it started to happen after I updated the following nuget packages to the 2.1.0 version:

<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Localization" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

For reference, here is my WebHostBuilder initialisation :

public static IWebHost BuildWebHost(string[] args) =>
       new WebHostBuilder()
            .UseKestrel()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .ConfigureLogging((hostingContext, logging) =>
            {
                if (hostingContext.HostingEnvironment.IsDevelopment())
                {
                    logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
                    logging.AddConsole();
                    logging.AddDebug();
                }
            })
            .UseIISIntegration()
            .UseDefaultServiceProvider((context, options) =>
            {
                options.ValidateScopes = context.HostingEnvironment.IsDevelopment();
            })
            .UseStartup<Startup>()
            .Build();

Does anyone have an idea on what I can do to resolve this?

like image 393
Alexandre Nourissier Avatar asked Jun 12 '18 15:06

Alexandre Nourissier


1 Answers

I don't have a great answer for this one. I was getting the same issues as you were describing. I updated my VS to 15.8.1 and the problem stopped. So I think the problem was with VS.

like image 145
Robyn Goodfellow Avatar answered Sep 22 '22 14:09

Robyn Goodfellow