我正在开发使用代码编辑器的 Blazor Server 应用程序。对于代码编辑器,我使用 CodeMirror。文本区域在 Blazor 页面上呈现良好,但数据绑定不适用于相应的 C# 字段。
我的_Host.cshtml文件如下:
@page "/"
@namespace BlazorApp1.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BlazorApp1</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<script src="~/codemirror/codemirror.js"></script>
<link rel="stylesheet" href="~/codemirror/codemirror.css">
<script src="~/codemirror/mode/clike.js"></script>
<script src="~/codemirror/addon/display/fullscreen.js"></script>
<link rel="stylesheet" href="~/codemirror/addon/display/fullscreen.css">
<link rel="stylesheet" href="/codemirror/theme/monokai.css">
<script>
function loadCodeEditor() {
var codemirrorEditor = CodeMirror.fromTextArea(document.getElementById('codearea'), {
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
mode: …Run Code Online (Sandbox Code Playgroud) 我在 Visual Studio 2019 中创建了一个新的 ASP.NET Core MVC 项目,并选中了启用 HTTPS 的选项。当我使用 IIS Express 运行项目时,网页显示“连接已重置”。
当我第一次为项目启用 SSL 并以调试模式启动时,visual studio 提示我信任自签名证书,我单击是。但是,在浏览器中,站点没有打开,并且显示错误“连接已重置”。
该应用程序在端口 44300 上运行。
这是 Windows 10 和 Visual Studio 2019 的全新安装。
我验证了 IIS 生成的自签名证书存在于证书存储中(请参阅屏幕截图)。此外,该证书也存在于 Edge Chromium 和 Google Chrome 浏览器的受信任根证书颁发机构中。
我创建了一个新项目以确保我的配置或构建文件中没有任何错误。当我运行新项目时,我得到相同的结果。
我也尝试过其他浏览器,但仍然是同样的错误。
我使用 Visual Studio 安装程序修复了 Visual Studio,并将所有内容重置为默认值,但没有成功。
请告知如何解决此问题。
以下是 Jexus 经理的报告:
SSL 诊断报告:
IMPORTANT: This report might contain confidential information. Mask such before sharing with others.
-----
System Time: 10/19/2020 8:01:52 AM
Processor Architecture: AMD64
OS: Microsoft Windows …Run Code Online (Sandbox Code Playgroud)