IIS Express module "AspNetCoreModuleV2" is removed after installing Visual Studio 17.1.1, breaking IIS Express support
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
In short, IIS Express no longer works with .NET Core applications after installing Visual Studio version 17.1.1. You can easily see this when selecting “IIS Express” as the server to build and run the application from within Visual Studio. You will receive an error message stating:
The ASP.NET Core Module is required to host ASP.NET Core projects in IIS Express and does not appear to be installed. Try repairing Visual Studio to correct the problem.
NOTE: I have tried uninstalling, reinstalling, and repairing Visual Studio 2022, and it does not fix the error. Something in Visual Studio version 17.1.1 removes the ASP.NET Core Module for IIS Express altogether, so no amount of repairing will fix the issue.
Detailed Info:
When I develop locally for ASP.NET 6, I use IIS Express with a web.config file pointing to my web application’s DLL file. I’ve been doing this for every version of .NET Core. Today however, after upgrading from Visual Studio 17.0.1 to version 17.1.1, I tried starting up my web application the way I always do, but started getting a web.config error (IIS Express is unable to read my web.config file). This is my web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" hostingModel="inprocess" disableStartUpErrorPage="false">
</aspNetCore>
</system.webServer>
</location>
</configuration>
This is the screen that I first got:
I noticed after I removed the <aspNetCore>
section, I got a more detailed error message:
Handler "aspNetCore" has a bad module "AspNetCoreModuleV2" in its module list
So, it looks like the module “AspNetCoreModuleV2” is no longer recognized by IIS Express. To confirm this, I checked IIS Express’s C:\Program Files\IIS Express\AppServer\applicationhost.config file. Sure enough, the “AspNetCoreModuleV2” section was removed from IIS Express’s configuration. Normally, there is a module listed as <add name="AspNetCoreModuleV2" image="%IIS_BIN%\Asp.Net Core Module\V2\aspnetcorev2.dll" />
:
Expected Behavior
IIS Express’s configuration file located at C:\Program Files\IIS Express\AppServer\applicationhost.config should have a globalModule item called “AspNetCoreModuleV2”, like this:
<add name="AspNetCoreModuleV2" image="%IIS_BIN%\Asp.Net Core Module\V2\aspnetcorev2.dll" />
After the .NET 6.0.3 update, this was removed, breaking IIS Express’s support for ASP.NET 6.0.3 applications.
Steps To Reproduce
Install .NET 6.0.3 and try running a 6.0.3 web application with IIS Express.
Exceptions (if any)
No response
.NET Version
6.0.3
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (10 by maintainers)
Top GitHub Comments
@adityamandaleeka, this should go to someone on the ASP.NET side. I promised @Pilchie I’d help out by looking at setup issues
This should be fixed in the May release of 17.1/17.2.