启动时报了2个错:
1、 AggregateException: One or more errors occurred. (HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.) (HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.)
2、NotSupportedException: HTTP/2 over TLS is not supported on Windows 7 due to missing ALPN support.
我的解决办法:
打开 appsetting.json 文件 ,这部分
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
}
客户端可以全部删除,或者删除 “EndpointDefaults”节点内容。
服务端可以修改,将“Endpoint”改为 “EndpointDefults”:例如
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://+:5000"
},
"Https": {
"Url": "https://+:5001"
},
"Http2": {
"Url": "http://+:5002",
"Protocols": "Http2"
}
}
其中,5000和5001 都是服务端的启动端口( launchSetting.json文件中 Profiles:ApplictionUrl 内容)