I would like to know the difference between ASPNetCoreModule and ASPNetCoreModuleV2, when to use each of them in which scenario.
Asked
Active
Viewed 8,139 times
1 Answers
27
ASPNetCoreModule
("version 1") is the IIS Module that enables IIS to run ASP.NET Core 1.x and 2.x applications when they're running in .NET Core- ASP.NET Core 1.x and 2.x (but not ASP.NET Core 3.x and later) can alternatively run on top of .NET Framework, instead of .NET Core, in which case you can use IIS' built-in CLR pipeline without the need for
ASPNetCoreModule
. - Version 1 was discontinued and removed from the ASP.NET GitHub repo in January 2019. The only reason you would be using V1 today is if you're still running an ASP.NET Core 1.x application.
- Which you should not be doing anyway.
- ASP.NET Core 1.x and 2.x (but not ASP.NET Core 3.x and later) can alternatively run on top of .NET Framework, instead of .NET Core, in which case you can use IIS' built-in CLR pipeline without the need for
ASPNetCoreModuleV2
supports ASP.NET Core 2.0 and later (including ASP.NET Core 3.x, .NET 5, .NET 6, etc). It also supports more features than V1 (such as custom offline messages).
when to use each of them in which scenario.
Here's a flowchart:
- Are you looking to run your ASP.NET Core application in IIS (without running on the .NET Framework)?
- Yes:
- Are you targeting ASP.NET Core 1.x?
- Yes (you masochist)
- Use
ASPNetCoreModule
(V1) and update to ASP.NET Core 3.1 LTSB pronto.
- Use
- No
- Use
ASPNetCoreModuleV2
- Use
- Yes (you masochist)
- Are you targeting ASP.NET Core 2.x, ASP.NET Core 3.x, .NET 5 or .NET 6?
- Yes
- Use
ASPNetCoreModuleV2
- Use
- No
- Then this entire StackOverflow question is irrelevant to you
- Yes
- Are you targeting ASP.NET Core 1.x?
- No
- You don't need
ASPNetCoreModule
norASPNetCoreModuleV2
- You don't need
- Yes:
In short: there is no reason to be using ASPNetCoreModule
("V1") today.

Dai
- 141,631
- 28
- 261
- 374
-
My IIS shows both.. how do I go about removing ASPNetCoreModule (V1) from it ? – joedotnot Nov 18 '21 at 03:24
-
@joedotnot What do you mean by "My IIS shows both"? **Where** are you seeing it? as for removing it, haven't you looked in the Add/Remove Programs control panel? – Dai Nov 18 '21 at 03:47
-
My IIS shows both means "in IIS Manager itself". Go to top node in tree (root / server), Modules icon, double-click, there are 2 ASPNetCoreModules, one for V1 and V2 - as your answer says NO REASON to use V1 I want to remove it because it is installed on my "server". ( I don't think it's related to Add/Remove programs, it was installed when I installed dotnet core preview 1.x, I am even struggling to remove this preview ) EDIT Ok, I can easily right click on that line, and Remove. – joedotnot Nov 18 '21 at 08:12
-
The flowchart is missing the fact that you can use ANCMv2 module to pass socket connections directly to a standalone process. This pass-through allows you to run any web server you like, but requires a startup script that runs a local web server. E.g. a Python Flask app served via waitress. – Mark Z. Feb 12 '23 at 13:32
-
@MarkZ. Interesting, I didn't know that - do you have a reference to the docs on that? (But hang on - surely you don't even need ANCMv2 for that, you could use the IIS/`HTTP.sys` interfaces directly? – Dai Feb 12 '23 at 16:12
-
@Dai I more or less lifted that statement from here: https://learn.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows and have run Python apps successfully using that approach (most recently, a dashboard site built with Plotly Dash (which is Flask under the hood). What is confusing is there is no mention of ANCM there, instead this doc recommendeds HttpPlatformHandler which is pretty much dead but ANCMv2 is basically the successor of it and you'll see the attributes there are the same, just swap out httpPlatform with aspNetCore – Mark Z. Feb 13 '23 at 05:14