Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ASP.NET Core Module is required" when running in Visual Studio #51

Closed
Bouke opened this issue Feb 22, 2023 · 5 comments
Closed

"ASP.NET Core Module is required" when running in Visual Studio #51

Bouke opened this issue Feb 22, 2023 · 5 comments

Comments

@Bouke
Copy link

Bouke commented Feb 22, 2023

Steps to reproduce

  • mkdir SystemWeb
    cd SystemWeb
    dotnet new systemwebfull
    
  • Open SystemWeb.csproj in Visual Studio Community 2022
  • Start Debugging (F5)

What happens

Visual Studio now shows this error message: "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."

When I try to run the project in Rider, I need to disable the Core Module by removing the following from applicationhost.config.

<add name="AspNetCoreModuleV2" image="C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" />

In Rider I can then run the project in IIS Express, but not debug it. The debug button becomes greyed out, so it's probably trying to start something or wait on something that doesn't happen.

What should happen

How can I run/debug the project with Visual Studio, and debug it with Rider?

Update

For Rider, there's a workaround documented here. Not ideal, but debugging works. I think that with Visual Studio's launch profiles one can achieve the same in Visual Studio.

@CZEMacLeod
Copy link
Owner

I have just tried this and I cannot reproduce it. Can you confirm which version of VS you have installed, and which operating system. It might also be useful to know if you have the global ANCM runtime installed. There is an issue with V17.5 of VS - but I'm not sure if this is related. I've tried V17.6.0P1.0 and V17.4.5.
There is a launch settings file included in the template.
Please ensure you have the latest templates installed.
The line in the generated file .vs\{projectname}\config\applicationhost.config I end up with is slightly different from yours, but I don't know why specifically.

<add name="AspNetCoreModuleV2" image="%IIS_BIN%\Asp.Net Core Module\V2\aspnetcorev2.dll" />

For reference I used

dotnet new systemwebfull -n test
cd test
start .

Then opened test.csproj in VS2022 Pro. And the file generated was .vs\test\config\applicationhost.config. I don't believe that Pro vs Community edition will make any difference.
It might be that there are some components I have installed (or not installed) that might make a difference - but it seems unlikely.

If I have time, I'm going to try this on the 'developer image in a box' available at https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ - I may have to add the ASP.NET and web development workload to that - I'm not sure if that is installed by default.

@CZEMacLeod
Copy link
Owner

@Bouke I've tried this on the windows developer image mentioned above and cannot replicate the issue you are describing.
I would suggest it is something local to your computer or setup, or you have not got some visual studio element installed.
Please ensure you are using VS2022 V17.4.4 or V17.6.0P1.0 (there is an issue with 17.5.0).
Any issues with the use of this in Rider will have to be taken up with their development team.

@Bouke
Copy link
Author

Bouke commented Jun 10, 2023

I've just updated from 17.1 to 17.6.2 and running the web project fails with the same error message:

image

@CZEMacLeod
Copy link
Owner

Do you have ANCM installed at all? It certainly isn't used when running systemweb based aspnet projects using this sdk, but maybe VS is doing an unnecessary check here.

@Meligy
Copy link

Meligy commented Jan 21, 2024

Has anyone solved this? I'm seeing it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants