强制使用SSL:错误途中发生试图确定DNX进程的进程ID承载应用程序 [英] Forcing to use SSL: An error ocurred attempting to determine the process id of the DNX process hosting your application

查看:874
本文介绍了强制使用SSL:错误途中发生试图确定DNX进程的进程ID承载应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用我的网站上的https执行。如果找到<一href=\"https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure-ssl-certificate/#4-enforce-https-on-your-app\"相对=nofollow>这篇文章,我用了code,它在那里。不幸的是,添加此code到web.config文件后,当我尝试打开我的网站上本地IIS出现此错误:

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:

这是错误途中发生试图确定托管应用程序DNX的进程id

An error ocurred attempting to determine the process id of the DNX process hosting your application

我的web.config文件看起来是这样的:

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>

从其他计算器问题,如启用匿名身份验证,或删除project.lock.json解决方案是行不通的。

Solutions from other stackoverflow questions like "Enable Anonymous Authentication" or deleting project.lock.json doesn't work.

我使用ASP.net核心RC1

I'm using ASP.net Core RC1

推荐答案

我带我穿过可怕的可能的解决方案会在几个小时发生错误attmepting确定DNX进程的进程ID承载应用程序的错误,直到我发现Tratcher的答案 - 这是没有标记为一个答案。

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.

如果一切都失败了,和你的项目使用或约束了SSL运行没有调试(CTRL + F5)第一次,它会问你生成一个本地的SSL证书,并调试完毕后会工作,错误将不复存在。

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.

感谢Tratcher!

Thanks Tratcher!

这篇关于强制使用SSL:错误途中发生试图确定DNX进程的进程ID承载应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆