I have same issue on Windows 10 and IIS version is 10. This solution works for me:
On Windows 7 or later desktop systems when using IIS locally:
Navigate to Control Panel > Programs > Programs and Features > Turn Windows features on or off (left side of the screen).
Open Internet Information Services > World Wide Web Services > Application Development Features.
Select the checkbox for Application Initialization.
Using web.config, add the element with doAppInitAfterRestart set to true to the <system.webServer> elements in the app's web.config file add this section
<system.webServer>
<applicationInitialization doAppInitAfterRestart="true" />
</system.webServer>
After that you must change applicationHost.config two section change C:\Windows\System32\inetsrv\config\applicationHost.config
First section below:
<site name="yoursitename" id="3" serverAutoStart="true">
<application path="/" applicationPool="yoursitename" preloadEnabled="true" serviceAutoStartEnabled="true" serviceAutoStartProvider="ApplicationPreload">
<virtualDirectory path="/" physicalPath="C:\websites\yoursitename" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:8011:" />
</bindings>
</site>
Second section below:
<add name="yoursitename" autoStart="true" startMode="AlwaysRunning">
<processModel idleTimeout="00:00:00" />
<recycling>
<periodicRestart time="00:00:00" />
</recycling>
</add>
PS: if you want to stop the project completely you must stop in application pool.
Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/advanced?view=aspnetcore-6.0#application-initialization-module