visual-studio - Visual Studio 2019 : "This site can’ t provide a secure connection"on localhost

标签 visual-studio asp.net-core localhost visual-studio-2019 iis-express

我已经安装了 Visual Studio 2019 并卸载了 Visual Studio 2017。

现在,如果我用 https 启动一个 ASP.NET (Core) 站点,它总是在 Chrome 上显示:

This site can’t provide a secure connection



或在边缘

Can’t connect securely to this page



截图:

Chrome 合金:

enter image description here

边缘:

enter image description here

网址是正确的。这也一样http://localhost:56784/ (它重定向到 https)

enter image description here

试过

我试过的:
  • 更新了 Visual Studio 2019
  • 创建一个新的 ASP.NET Core 2 网站
  • 使用 ASP.NET 站点(非核心)进行测试
  • 使用 MMC 删除 IIS 证书
  • 检查/更改 Visual Studio 2019 中的 IIS 设置(带有上下文菜单的项目属性和带有 F4 的项目属性)
  • 在 Stackoverflow 和 Google 上搜索;)
  • 修复 Visual Studio 2019

  • 问题

    我认为这个问题是由:
  • 安装 Visual Studio 2019 和/或,
  • 卸载 Visual Studio 2017 和/或
  • 更新 Windows 10(当前版本:10.0.18362 Build 18362)

  • 下划线问题看起来像是错误/旧/不支持的 TLS 版本?



    我可以做什么来诊断/解决问题?

    最佳答案

    就像它对 @Nosnetrom 不起作用一样- 修复 IIS 10.0 Express 对我也不起作用。如 @Julian提到我的问题也是由卸载 VS 2017 引起的。
    这是什么不起作用为了我:

  • 卸载/重新安装 VS 2019
  • 安装 VS 2017
  • 卸载/重新安装/修复 IIS 10.0 Express

  • 这是什么有效为了我:
  • 阅读后this建议 - 我意识到我使用的是端口 51542 而不是 44300 到 44399 范围内的端口
    enter image description here
  • 然后我更新了 applicationhost.config 文件根据 this建议。该文件在我的 Windows 10 机器上的位置是:C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer\applicationhost.config .我必须以管理员身份在记事本中打开该文件,否则我无法保存这些更改:
    enter image description here
  • 然后在 Visual Studio 中我创建了一个新的 虚拟目录
    enter image description here
  • 这似乎对我有用 - 当我运行应用程序时,它起作用了
    enter image description here
  • 关于visual-studio - Visual Studio 2019 : "This site can’ t provide a secure connection"on localhost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58175973/

    相关文章:

    .net - 如何从powershell构建VS解决方案文件夹

    c# - 如何在vs2012中的某个位置获取所有警告消息的列表

    c++ - IBM Informix 数据库中 INT8 类型的 RFX 等效数据类型

    .htaccess - 在根文件夹中添加 .htaccess 文件时出现服务器错误 500

    c# - 将大量脚本作为嵌入式资源包含到项目中是一种不好的做法吗?

    iis - ASP.NET Core 无法在 IIS 下运行 : HTTP Error 500. 0 - ANCM In-Process Handler Load Failure

    c# - 无法在选择列表中保存多个选择 - asp.net core web 应用程序 razor 页面

    c# - .NET Core 使用 IdentityUser 创建不可为 null 的 FK 约束

    http - 使用 Deno 在本地网络上提供文件服务

    windows-7 - IIS 7 主机 header 不起作用