Unfortunately, none of the proposed solutions helped me. By some miracle, I found out that my applicationhost.config file was modified, unfortunately, due to which I got the error "Unable to add duplicate collection" when going to a specific page in my .NET Core web application.
Under the <sites> in applicationhost.config , I had the following:
<site name="MyWebsite" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\Users\___\solutionname\MyWebsite" /> </application> <application path="/SomePage" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\Users\___\solutionname\MyWebsite" /> </application> <bindings> <binding protocol="https" bindingInformation="*:12345:localhost" /> </bindings> </site>
The HTTP error 500.19 seemed to me when I went to the "/ SomePage" page. As you can see, for some reason there was a separate <application> tag for this particular page. I have no idea why.
I removed all this <application> for the path / SomePage and it worked again.
source share