Reputation: 11221
I want to enforce using https on my site. If found this article and I used the code that was there. Unfortunately, after adding this code to web.config, this error appears when I try to open my website on local IIS:
An error ocurred attempting to determine the process id of the DNX process hosting your application
My web.config looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Solutions from other stackoverflow questions like "Enable Anonymous Authentication" or deleting project.lock.json doesn't work.
I'm using ASP.net Core RC1
Upvotes: 3
Views: 1420
Reputation: 11
In addition to the great answer by Radosław Chybicki, which had worked for me a couple of times before, if it still doesn't work and you don't get the "install the certificate" stuff, you might need to repair your IIS express installation from the control panel. Go to Control Panel > Program and Features > right click on IIS Express installation and select repair.
I had accidentally deleted my IIS express certificate from my local computer certificate store.
Upvotes: 1
Reputation: 401
I took me a few hours of going through possible solutions of the dreaded "An error occurred attmepting to determine the process id of the DNX process hosting your application" error, until I found Tratcher's answer - which is not marked as an answer.
If everything else fails, and your project uses or enforces SSL run it without debugging (CTRL+F5) first, it will ask you to generate a local SSL cert, and after that debugging will work and the error will be gone.
Thanks Tratcher!
Upvotes: 10