Error 500.21 when running site on IISExpress using visual studio

498 Views Asked by At

I know this question was asked before but I couldn't find a solution that helped me anywhere and feel hopeless.

I'm developing asp.net web sites using iis express.

Recently after accidently messing with visual studio installations I started getting error 500.21 when running any web application through visual studio (I tried running it from all three I have installed - 2013, 2015, 2017). When doing so I get:

error 500.21 - 'Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list.'

All the projects web.config file has not been changed, it is working for my other team members and has worked for me before, therefore I don't think the problem is there.

Things I've tried to track the issue:

  • When running sites directly using the IISExpress exe through the cmd, they run perfectly, which makes me think the problem is related to visual studio perhaps, and not related to IISExpress or it's applicationhost.config which seems to be ok.

  • Countless of reinstall/repair operations on all visual studio/iisexpress/aspnet components I have on my computer without success.

  • Running the "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i" which was mentioned alot when I searched this issue. Not working.

1

There are 1 best solutions below

0
On BEST ANSWER

It took me a while to figure out that the applicationhost.config that visual studio references to when running sites on IISExpress was in the .vs folder and not in the IISExpress folder itself.

The file in the .vs folder was corrupted and after replacing it with the applicationhost.config from the IISExpress folder things started working out