啓動時報了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”節點內容。
服務端可以修改,將“EndpointDefaults”改爲 “EndpointDefults”:例如
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://+:5000"
},
"Https": {
"Url": "https://+:5001"
},
"Http2": {
"Url": "http://+:5002",
"Protocols": "Http2"
}
}
其中,5000和5001 都是服務端的啓動端口( launchSetting.json文件中 Profiles:ApplictionUrl 內容)