当我以http://localhost:26049身份访问站点时,站点运行正常.如果我试图用https://localhost:44319访问该站点,我得到的结果是找不到页面.

这是我的项目属性:

项目属性

这来self 的IISExpress应用程序配置:

<site name="MVC Authentication" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="F:\Projects\MySite\Test" />
    </application>
    <bindings>
        <binding protocol="https" bindingInformation="*:44319:localhost" />
        <binding protocol="http" bindingInformation="*:26049:localhost" />
    </bindings>
</site>

推荐答案

从这篇文章中得到了解决方案.必须删除所有本地主机证书并修复IIS Express.谢谢@ShaTin

https://stackoverflow.com/a/22818853/853295

请确保删除任何以前的"localhost"证书,因为这些证书可能与IIS Express生成的证书冲突.我也有同样的错误(ERR_SSL_PROTOCOL_error),在try 了许多"解决方案"后,我花了很多小时才最终弄明白.我的错误是,我创建了自己的"localhost"证书,其中有两个.我必须删除这两个,并让IIS Express重新创建它.

以下是判断和删除"localhost"证书的方法:

On Start, type -> mmc.exe, File -> Add/Remove Snap-in..., Select Certificates -> Add> -> Computer account -> Local computer, Check under Certificates > Personal > Certificates. Make sure the localhost certificate that exist has a friendly name "IIS Express Development Certificate". If not, delete it. Or if multiple, delete all. On Visual Studio, select project and under property tab, enable SSL=true. Save, Build and Run. IIS Express will generate a new 'localhost' certificate.

Note: If it doesn't work, try these: make sure to disable IIS Express on VS project and stopping all running app on it prior to removing 'localhost' certificate. Also, you can go to 'control panel > programs' and Repair IIS Express.

Asp.net相关问答推荐

IIS重写模块排除机器人但允许GoogleBot

'dotnet --version is returning您必须安装或更新.NET才能运行此应用程序.三十九岁;

页面刷新后如何存储JS Select 数据

JWT 和 Google 在 Razor 页面中进行身份验证和授权

在 Windows Server 2008 IIS7 上的 ASP.NET 中写入事件日志(log)

强制从 /bin 而不是 GAC 加载程序集?

带有模型的 mvc 上传文件 - 第二个参数发布的文件为空

asp.net dropdownlist - 在 db 值之前添加空行

用户NT AUTHORITY\NETWORK SERVICE登录失败

Directory.Exists 不适用于网络路径

如何计算/查找给定日期的周数?

如何在 ASP.NET 应用程序中使用 jQuery 捕获提交事件?

如何从 JS 访问 ViewBag

错误:无法在 Web 服务器上开始调试... ASP.NET 4.0

这个rendersection的代码是什么意思?

远程计算机无法连接到 Visual Studio Web 服务器

ASP.net 网站中的 C# 密码文本框

DateTime.Parse 和 Convert.ToDateTime 之间有什么区别?

如何加密 web.config 中的一项

Application_End global.asax