【发布时间】:2021-02-06 18:40:38
【问题描述】:
我试图在我的 Windows 8.1 机器上运行 Blazor Web Assembly 应用程序,但没有成功。由于 Windows 8.1 操作系统不推荐 Kestrel 模式,我在其他示例项目(MVC、Razor Page、Blazor Server 和 API)中使用了这种硬编码在 appsettings.js 符号:
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http1"
}
}
而且效果很好。 但是在 Blazor Web Assembly 应用程序 上没有任何 appsettings.js 文件。 appsettings.js 有一个具有这种默认结构的 launcheSettings.json 文件:
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:55974",
"sslPort": 44318
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BlazorClientDemoApp": {
"commandName": "Project",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
当我尝试对上述 Kestrel 的代码进行硬编码时,应用程序不会出现在浏览器上。
在 Windows 8.1 操作系统上可以做到吗?
规格:
Windows 8.1 64bit
VisualStudio 2019: 16.7.6 version,
SDK 3.1.403 Core,
Microsoft .NET Framework Wersja 4.8.03761,
ASP.NET and Web Tools 2019 16.7.532.,
ASP.NET Core Razor Language Services 16.1.0.,
ASP.NET Web Frameworks and Tools 2019 16.7.532.28833
【问题讨论】:
标签: asp.net-core windows-8.1 blazor-client-side blazor-webassembly kestrel