c# - 从 netcore2.2 到 netcore3.0 的迁移项目
问题描述
我在 netcore2.2 中有一个 Identity Server 4 项目现在我想迁移到 netcore3.0 我已经安装了 sdk 托管包等等...在 appsetting 更改目标框架中更改版本 sdk 如果我编译告诉我好的但是.. .
我的旧 startup.cs 在 ConfigureService 中有这个调用:
services.AddMvc(options => options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build())))
.AddJsonOptions(options =>
{
options.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Include;
options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
});
和 netcore 3.0 告诉我 options.SerializerSettings.DefaultValueHandling 和 options.SerializerSettings.NullValueHandling
它们不被认为是有效的
所以我拿出来......另一个问题是,当使用调试时看到不同的步骤,这个调用中的断点不会进入'
services.AddDbContext<DBPLATFORMContext>(options =>
{
options.UseSqlServer(connectionString,
sqlServerOptionsAction: sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(30),
errorNumbersToAdd: null);
});
});
当我开始我的索引页时
在“配置”中
app.Use(async (context, next) => {
await next();
if (context.Response.StatusCode == 404 &&
!Path.HasExtension(context.Request.Path.Value) &&
!context.Request.Path.Value.StartsWith("/api/"))
{
context.Request.Path = "/index.html";
await next();
});
变量上下文给我响应 404 并且内容类型为空
你可以帮帮我吗?谢谢
解决方案
推荐阅读
- php - 使用路由资源不支持 POST 方法
- ansible - 使用 ansible win_file 在 Windows 上的 azure 文件存储共享中创建文件夹
- javascript - 从 onclick 按钮事件向选项卡添加活动类
- list - 如何在剃刀视图中显示 Orchard Core CMS 的 ListPart 项?
- stored-procedures - JdbcTemplate 调用存储过程调用
- ios - 在特定日期使用 Timer 调用函数
- java - HashMap 的 Java Getter
- c++ - 使用引用的类字符串设置器
- powershell - 我可以使用 Invoke-WebRequest 将二进制数据写入文件并仍然获得状态码吗?
- xcode - 在 xcode-select --install 之后收到警报“由于网络问题无法下载软件”