小编brr*_*rth的帖子

模板中的新 ASP.NET Core 应用程序在运行时给出“无法访问此站点”

我是 ASP.NET core 新手,我正在尝试在我的计算机 (Windows 8.1) 上启动一个新的 ASP.NET core 应用程序。我正在关注https://learn.microsoft.com/en-us/aspnet/core/getting-started/?view=aspnetcore-3.1&tabs=windows上的教程(这是最基本的):

\n
    \n
  1. 通过以下方式创建应用程序:dotnet new webapp -o aspnetcoreapp
  2. \n
  3. 通过以下方式信任证书:dotnet dev-certs https --trust
  4. \n
  5. 通过以下方式运行应用程序:dotnet watch run
  6. \n
\n

当我运行应用程序并在 Chrome 中导航到 https://localhost:5001/ 时,收到以下错误:

\n
\n

无法访问此站点\xe2\x80\x99
\n位于 https://localhost:5001/ 的网页可能暂时无法访问,或者可能已永久移至新网址。
\nERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY

\n
\n

对我来说,这感觉像是一个证书问题,所以我点击了“信任开发证书部分”下的链接,然后尝试通过以下方式删除并重新添加旧证书:

\n
dotnet dev-certs https --clean\ndotnet dev-certs https --trust\n
Run Code Online (Sandbox Code Playgroud)\n

但这没有帮助。

\n

运行 dotnet watch run 时,我没有看到任何错误。这是输出:

\n
watch : Started  \ninfo: Microsoft.Hosting.Lifetime[0]  \n      Now listening on: https://localhost:5001  \ninfo: Microsoft.Hosting.Lifetime[0]  \n      Now listening on: http://localhost:5000  \ninfo: …
Run Code Online (Sandbox Code Playgroud)

http2 asp.net-core

2
推荐指数
1
解决办法
1578
查看次数

标签 统计

asp.net-core ×1

http2 ×1