当我通过Visual Studio 2017(15.7.3)开始调试时,为什么要创建IIS 10应用程序池?

Ale*_*ier 8 iis application-pool asp.net-core visual-studio-2017 asp.net-core-2.1

编辑1:我使用相同的配置遇到与ASP NET Core 2.0应用程序相同的问题,因此这本身排除了框架.下一个潜在的罪魁祸首:.NET Core 2.1 SDK(v2.1.300)糟糕的Visual Studio更新(15.7.3).


我调试API时,IIS 10和ASP NET Core 2.1.0有一个奇怪的问题.

我有一个IIS网站" api.local ",里面有一个ASP NET Core 2.0应用程序" v1 ".

"v1"应用程序配置为使用我创建网站时生成的"api.local"应用程序池.此应用程序池配置如下:

  • .Net CLR版本:无托管代码
  • 管理管道模式:集成
  • 身份:ApplicationPoolIdentity

为了在Visual Studio 2017(15.7.3)中进行调试,我使用以下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/"
        }
   } 
}
Run Code Online (Sandbox Code Playgroud)

一切都很好.


现在,每次我开始调试时,都会创建一个名为"v1 AppPool"(然后是"v1 AppPool 2"等)的新IIS应用程序池,并且"v1"网站配置将更改为使用此新创建的IIS Applicataion池.

我不知道从什么时候开始,但我认为在将以下nuget软件包更新到2.1.0版本之后就开始了:

<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" />
Run Code Online (Sandbox Code Playgroud)

作为参考,这是我的WebHostBuilder初始化:

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();
Run Code Online (Sandbox Code Playgroud)

有没有人知道我能做些什么来解决这个问题?

Rob*_*low 2

对于这个问题我没有一个很好的答案。我遇到了与您所描述的相同的问题。我将 VS 更新到 15.8.1,问题就停止了。所以我认为问题出在VS上。