.netcore 2 升级 .netcore 3.1 相关issue
1、
“HttpContent”未包含“ReadAsAsync”的定义,并且找不到可接受第一个“HttpContent”类型参数的可访问扩展方法“ReadAsAsync”(是否缺少 using 指令或程序集引用?)
方法:引用Microsoft.AspNet.WebApi.Client
2、
“IConfigurationBuilder”未包含“AddEnvironmentVariables”的定义,并且找不到可接受第一个“IConfigurationBuilder”类型参数的可访问扩展方法“AddEnvironmentVariables”(是否缺少 using 指令或程序集引用?)
方法:引用Microsoft.Extensions.Configuration.EnvironmentVariables
3、
“IServiceCollection”未包含“AddApplicationInsightsTelemetry”的定义,并且找不到可接受第一个“IServiceCollection”类型参数的可访问扩展方法“AddApplicationInsightsTelemetry”(是否缺少 using 指令或程序集引用?)
方法:引用Microsoft.ApplicationInsights.AspNetCore
4、
Application startup exception: System.InvalidOperationException: Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...).
方法:增加以下代码
services.AddMvc (option => { option.EnableEndpointRouting = false; })
5、
TypeLoadException: Could not load type 'Microsoft.AspNetCore.Authentication.Internal.RequestPathBaseCookieBuilder' from assembly 'Microsoft.AspNetCore.Authentication, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
方法:升级Microsoft.AspNetCore.Authentication.OpenIdConnect
版本
6、与IdentityServer4 交互报如下错
方法:将http
改成https