I have an ASP.NET site running on .NET 4.6.2.
However, Visual Studio 2019 (and 2022) is trying to launch it as an ASP.NET Core site.
Webpage shows:
HTTP Error 500.0 - ASP.NET Core IIS hosting failure (in-process)
Event Viewer shows
Event 1031, IIS Express AspNetCore Module V2 error:
Application 'C:\Projects\Web\WebSvc' failed to start. Exception message:
Executable was not found at 'C:\Projects\Web\WebSvc%LAUNCHER_PATH%.exe'
I have several business libraries that are dual targeted netstandard2.1;net461.
Web.config has 4.6.2 as targetFramework:
<httpRuntime targetFramework="4.6.2" maxRequestLength="2147483647" />
<compilation debug="true" targetFramework="4.6.2" />
What prompts Visual Studio to try and run this project as ASP.NET Core?
CodePudding user response:
IISExpress was the cause of the issue- along with shared dev ports. Another project (dotnet core 3.1) was configured with the same port, so when the virtual directory was created by project 2, it was set to run AspNetCore Module V2.
Changing the project's port cleared up the error.