.NET9 开始删除内置的 Swagger 支持 可使用Scalar.AspNetCore替代

Microsoft 已决定从 .NET 9 中删除内置的 Swagger 支持 (Swashbuckle)。为什么 Swagger (Swashbuckle) 被删除?ASP.NET Core 团队已决定从 .NET 9 中删除内置的 Swagger 支持 (Swashbuckle),原因如下。

2024-11-13 1540 0 .NET9 .NET Swagger Scalar.AspNetCore

@import '_content/Microsoft.AspNetCore.Components.QuickGrid/Microsoft.AspNetCore.Components.QuickGrid.bundle.scp.css'

无意中发现.NET Core MVC项目会引用下面的css,但是实际项目中不存在这个文件。担心会404就想把它删了,但是实际运行后发现css是能加载成功的,打开内容是这样的:@import '_content/Microsoft.AspNetCore.Components.QuickGrid/Microsoft.AspNetCore.Components.QuickGrid.bundle.scp.css';

2024-03-20 1234 0 import _content AspNetCore QuickGrid css

Microsoft.AspNetCore.Session已弃用 .NET6如何使用Session

在 .NET 6 中,Microsoft.AspNetCore.Session 已弃用。在 .NET 6 中,微软官方建议使用 IDistributedCache 接口来实现会话。IDistributedCache 接口提供了一个通用的 API,用于在各种缓存存储中存储数据。如果我们只是用本地内存缓存的话,实现很简单,跟使用Microsoft.AspNetCore.Session包的时候一样,只是从.NET6开始不需要安装Microsoft.AspNetCore.Session包就可以实现Session了。

2024-01-09 1777 0 Microsoft.AspNetCore.Session 弃用 Session .NET6 .NET

.NET8 AOT报错:System.IO.FileNotFoundException: Could not find file 'Microsoft.AspNetCore'

AOT在Visual Studio中运行是没有问题,但要采用默认的发布配置就会报错。然后再次运行发布,系统会提示发布成功,但当运行程序时,应用会提示打不到Microsoft.AspNetCore,具体错误如下:Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'Microsoft.AspNetCore'.

2023-11-28 2183 0 .NET8 AOT AOT报错 System.IO.FileNotFoundException Microsoft.AspNetCore

.NET Core限制请求频率中间件 AspNetCoreRateLimit

在.NET Core中,我们可以使用ASP.NET Core的中间件来对Web API进行流量限制。ASP.NET Core提供了一个名为RateLimit的开源库,可以方便地实现流量限制功能。下面将详细介绍如何在.NET Core中使用RateLimit库对Web API进行流量限制,并给出相应的示例代码。

2023-10-18 1912 0 .NET .NET Core 请求频率 中间件 AspNetCoreRateLimit

jwt是什么?.NET Core API如何使用JwtBearer验证

在.NET Core中,可以通过添加Microsoft.AspNetCore.Authentication.JwtBearer NuGet包来使用JWT身份验证。

2023-03-04 2540 0 jwt .NET Core API Microsoft.AspNetCore.Authentication.JwtBearer JwtBearer用法

最新评论
顶部