Search code examples
reactjsvisual-studio-2019asp.net-core-3.1

Unable to get process ID of the IIS application pool 'ReactDemo AppPool'


I created a new .net core and reactjs project in VS 2019. It set the default web server to IISExpress, I want to use IIS 10.0 that is installed on my box. I created a virtual app under my main app in IIS called ReactDemo. It created an AppPool in IIS called ReactDemo AppPool, but I don't want to use that and deleted it. I assigned the app to an already existing app pool 'DemoAppPool'.

I updated the profile in the project to use IIS and pointed to the virtual app in IIS.

When I run the project I get this error:

enter image description here

here is my profile settings:

enter image description here

Here is my lauchSettings.json:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iis": {
      "applicationUrl": "http://localhost:81/ReactDemo",
      "sslPort": 0
    }    
  },
  "profiles": {    
    "ReactDemo": {
      "commandName": "IIS",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:81/ReactDemo",
      "jsWebView2Debugging": false
    }   
  }
}

How or where do I specify which app pool to use in the project in order to get this to run. Why does it want to use an app pool named after the project?


Solution

  • Found the solution in this answer:

    Since .NET Core 2.2 there is another option: InProcess hosting If you activate InProcess hosting, IIS uses an in-process server implementation for IIS called IISHttpServer. This implementation as well as the Core app itself run in the same process as the IIS worker process. This reduces the resource footprint and increases performance. There is one limitation though: Each InProcess hosting site in ISS needs a dedicated application pool. You cannot use the same application pool for multiple sites that are configured for InProcess hosting!