Core 学习过程
Core
1. https://ken.io/serie/dotnet-core-quickstart
Asp.Net Core 系列教程 (一)
2. https://blog.csdn.net/hotmee/article/details/84281858
MiddleWare
3.https://www.cnblogs.com/ken-io/tag/ASP.NET%20Core%20%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B/
ASP.NET Core 3 系列 - Middleware
4.https://blog.johnwu.cc/article/asp-net-core-3-middleware.html
Asp.Net Core 快速入门
https://www.cnblogs.com/wyt007/category/1130278.html
3. IOC
https://blog.csdn.net/zyq025/article/details/108143876
public class ResolverServices : Autofac.Module
{
private static IContainer _container;
protected override void Load(ContainerBuilder builder)
{
builder.RegisterBuildCallback(container =>
{
_container = (IContainer)container;
});
}
}
【转载】ASP.NET Core 依赖注入
https://www.cnblogs.com/wyt007/p/8065075.html
在AspNetCore3.0中使用Autofac
https://www.cnblogs.com/diwu0510/p/11562248.html
彪悍的人生不需要解释,彪悍的代码不需要注释。
*.NET Core3.0 Autofac注入
https://www.cnblogs.com/ingstyle/p/11836157.html
Autofac 之 基于 Castle DynamicProxy2 的 Interceptor 功能
https://www.cnblogs.com/god--love-you/p/5699632.html
4.ASP.NET Core 3 系列 - 程式生命週期 (Application Lifetime)
https://blog.johnwu.cc/article/asp-net-core-3-application-lifetime.html
****5. .netcore教程 ---------ALL
https://blog.csdn.net/u010476739/category_9309172_2.html
6. .netcore入门11:aspnetcore自带cookie的认证期限分析
https://blog.csdn.net/u010476739/article/details/104474850
.NET Core请求控制器Action方法正确匹配,但为何404?
https://www.cnblogs.com/CreateMyself/p/13186026.html
7. asp.net-core – ASP.NET Core WebAPI默认路由不起作用
解决方法
如@tmg所述,请执行以下操作:
右键单击您的Web项目 – >选择属性 – >选择左侧的Debug选项卡 – >然后编辑“启动网址”字段以设置您自己的默认启动网址.
8.asp.netCore3.0 中使用app.UseMvc() 配置路由
http://www.bubuko.com/infodetail-3298431.html
9.0
【ASP.NET Core快速入门】(十一)应用Jwtbearer Authentication、生成jwt token
https://www.cnblogs.com/wyt007/p/8183085.html
【ASP.NET Core快速入门】(十二)JWT 设计解析及定制
https://www.cnblogs.com/wyt007/p/8196747.html
ASP.NET Core-自定义Jwt token验证(ISecurityTokenValidator)
https://www.cnblogs.com/fanfan-90/archive/2004/01/13/13302205.html
9.1 .NET CORE 解析token
https://blog.csdn.net/xiaomifengmaidi1/article/details/90260588
new JwtSecurityTokenHandler().ReadToken("") will return a SecurityToken
new JwtSecurityTokenHandler().ReadJwtToken("") will return a JwtSecurityToken
new JwtSecurityToken(accessToken),这种试了也可以
获取里面的属性 比如oid 直接tokenS.Claims.FirstOrDefault(m => m.Type == "oid").Value
_____________________________________________________________________________________
9.2 ASP.NET Core利用拦截器 IActionFilter实现权限控制
http://www.zyiz.net/tech/detail-128132.html
9.3 .net core 登入全局验证过滤器
https://www.cnblogs.com/amylis_chen/archive/2004/01/13/12469067.html
Asp.net core mvc里面怎么添加全局的Filter
https://blog.csdn.net/my98800/article/details/80088619
Net Core 2.1Filter里面获取Controller、Action,请求方法,请求头部,请求参数
https://blog.csdn.net/mango_love/article/details/84992020
MVC及MVC Core在filter中如何获取控制器名称和Action名称
https://www.cnblogs.com/ceci/p/10042519.html
_____________________________________________________________________________________________________________________________________
关于.NetCore 3.1 Authentication跟Authorization的区别
app.UseAuthentication();//鉴权,检测有没有登录,登录的是谁,赋值给User
app.UseAuthorization();//就是授权,检测权限
在.net 2.1中是没有UseAuthorization方法的,这两个单词长的十分相似,而且还经常一起出现,很多时候容易搞混了。
在3.0之后微软明确的把授权功能提取到了Authorization中间件里,所以我们需要在UseAuthentication之后再次UseAuthorization。否则,当你使用授权功能比如使用[Authorize]属性的时候系统就会报错。
_____________________________________________________________________________________________________________________________________
10.从头编写 asp.net core 2.0 web api 基础框架 (5) EF CRUD
第1部分:http://www.cnblogs.com/cgzl/p/7637250.html
第2部分:http://www.cnblogs.com/cgzl/p/7640077.html
第3部分:http://www.cnblogs.com/cgzl/p/7652413.html
第4部分:http://www.cnblogs.com/cgzl/p/7661805.html
Github源码地址:https://github.com/solenovex/Building-asp.net-core-2-web-api-starter-template-from-scratch
11.C#.net framework .net core 3.1 请求参数校验, DataAnnotations, 自定义参数校验
https://www.cnblogs.com/fancyblogs/p/13100002.html?utm_source=tuicool&utm_medium=referral
12.Fluentvalidation的基本使用
https://www.cnblogs.com/zyz-Notes/p/11275113.html
13. log4j/Nlog 处理
NLog:
http://www.cnblogs.com/linezero/p/Logging.html ASP.NET Core 开发-Logging 使用NLog 写日志文件
https://blog.csdn.net/qq_36819973/article/details/108659975 loggerFactor.AddNLog 过时处理(.net core 3.1)
https://www.cnblogs.com/jkping/articles/13718476.html NLog配置与使用
https://www.cnblogs.com/fuchongjundream/p/3936431.html NLog类库使用探索——详解配置
https://www.cnblogs.com/lgx5/p/10158776.html 使用Nlog记录日志到数据库
$ {basedir} -应用程序运行的目录,又名 AppDomain.BaseDirectory
配置属性:
archiveAboveSize="1024" 含义为:设置文件大小属性,单位是字节.
maxArchiveFiles="30" 含义为:在当前文件夹下面最多生成30个文件.
archiveNumbering="Rolling" 含义为:滚动写入,不会新建文件,直接覆盖前面的文件
https://blog.csdn.net/liuzishang/article/details/99817158 [.Net Core学习九]自带Logging使用
https://www.cnblogs.com/kelelipeng/p/10476859.html .netcore 写日志(使用NLog,log4net)
注入NLog:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureLogging(logging=> {
logging.ClearProviders();
logging.SetMinimumLevel(LogLevel.Trace);
}).UseNLog();//注入NLog
}
Question:
“JsonOptions”未包含“SerializerSettings”的定义,并且找不到可接受第一个“JsonOptions”类型参数的可访问扩展方法“SerializerSettings”是否缺少 using 指令或程序集引用?
处理方法:
services.AddMvc().AddJsonOptions(options =>
{
//忽略循环引用
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
//不使用驼峰样式的key
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
修改为:
services.AddMvc().AddNewtonsoftJson(options =>
{
//忽略循环引用
options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
//不使用驼峰样式的key
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
});
查阅资料:
https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-3.0?view=aspnetcore-3.1
详细问题解决:
https://copyfuture.com/blogs-details/20200212104020689df299gdr49kpxun
14.NetCore 异常处理相关:
https://www.cnblogs.com/jhli/p/9808827.html 【netcore基础】MVC API全局异常捕捉中间件ExceptionHandlerMiddleWare
https://www.cnblogs.com/jiangchengbiao/p/10482979.html .NET Core通过过滤器和中间件两种方式实现全局异常捕获和日志记录
https://blog.csdn.net/ailanzhe/article/details/79726568 Asp.Net Core异常处理
ASP.NET Core应用的错误处理[1]:三种呈现错误页面的方式
ASP.NET Core应用的错误处理[2]:DeveloperExceptionPageMiddleware中间件
ASP.NET Core应用的错误处理[3]:ExceptionHandlerMiddleware中间件
ASP.NET Core应用的错误处理[4]:StatusCodePagesMiddleware中间件
15.
https://www.cnblogs.com/xybs/archive/2004/01/13/13219792.html
vs2019 缺少add-migration命令
解决方案:程序包管理控制台执行 Install-Package Microsoft.EntityFrameworkCore.Tools
16.
.Net Core EF 日志打印 SQL 语句
http://t.zoukankan.com/vipsoft-p-12897123.html
NET5 EF Core添加EF生成SQL日志记录
https://www.cnblogs.com/heibai-ma/p/14108579.html
public class Startup
{
public static readonly ILoggerFactory efLogger = LoggerFactory.Create(builder =>
{
builder.AddFilter((category, level) => category == DbLoggerCategory.Database.Command.Name && level == LogLevel.Information).AddConsole();
});
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<EFCoreContext>(options =>
{
options
.UseSqlServer(Configuration.GetConnectionString(nameof(EFCoreContext)))
.UseLoggerFactory(efLogger);
});
}
}
17.
ASP.NET Core 3.0 使用gRPC
https://www.cnblogs.com/stulzq/p/11581967.html
问题:
启动grpc报错:HTTP/2 over TLS is not supported on Windows 7
http://tnblog.net/aojiancc/article/details/3210
深入 ProtoBuf - 简介
https://www.jianshu.com/p/a24c88c0526a
18.
ASP.NET Core 3.1使用Swagger
https://www.cnblogs.com/dotnet261010/p/12425572.html
NetCore WebApi——Swagger简单配置
https://www.cnblogs.com/jixiaosa/p/10759832.html
.net core的Swagger接口文档使用教程(一):Swashbuckle
https://www.cnblogs.com/shanfeng1000/p/13476831.html
有时间真应该看看老外的 Core
1. <ASP.NET Core in Action> 2Edition
2. ASP.NET Core 2 High Performance
-
Performance Improvements in .NET 5.0
-
Arm64 Performance in .NET 5.0
-
gRPC.
深度探秘.NET 5.0说明篇
https://www.cnblogs.com/yxcn/p/13999081.html
19.在ASP.NET Core中使用托管启动(hosting startup)程序集,实现批量注册service
https://www.cnblogs.com/wangyfb/p/11765688.html
20. 自定义配置数据源与配置中心方案
https://www.cnblogs.com/Adoni/p/12652535.html
21. 使用ChangToken配置变更监听
https://www.cnblogs.com/Xieyiincuit/p/13977405.html
https://cloud.tencent.com/developer/article/1552127
[ASP.NET Core 3框架揭秘] 配置[1]:读取配置数据[上篇]
[ASP.NET Core 3框架揭秘] 配置[2]:读取配置数据[下篇]
[ASP.NET Core 3框架揭秘] 配置[3]:配置模型总体设计
[ASP.NET Core 3框架揭秘] 配置[4]:将配置绑定为对象
[ASP.NET Core 3框架揭秘] 配置[5]:配置数据与数据源的实时同步
[ASP.NET Core 3框架揭秘] 配置[6]:多样化的配置源[上篇]
[ASP.NET Core 3框架揭秘] 配置[7]:多样化的配置源[中篇]
[ASP.NET Core 3框架揭秘] 配置[8]:多样化的配置源[下篇]
[ASP.NET Core 3框架揭秘] 配置[9]:自定义配置源
__________________________________________________________________________________
1. <ASP.NET Core in Action> 2Edition
2. ASP.NET Core 2 High Performance
__________________________________________________________________________________________
ASP.NET Core使用HostingStartup增强启动操作
https://blog.csdn.net/sd7o95o/article/details/110101631
.NET Core 配置Configuration杂谈
https://www.cnblogs.com/stulzq/p/8570496.html
__________________________________________________________________________________________
.NET Core 选项模式【Options】的使用
https://www.cnblogs.com/zhanwei103/p/13161553.html
Unnamed option example:
//in Startup.cs
services.AddOptions<MyOptionsClass>()
.Configure(o =>
{
o.Data = "test";
});
//then in the controller
public MyController(IOptionsMonitor<MyOptionsClass> optionsAccessor)
{
//note: Configure is called as MyController gets created by DI
var data = optionsAccessor.CurrentValue.Data;
}
Named option example:
//in Startup.cs
services.AddOptions<MyOptionsClass>("optionalOptionsName")
.Configure(o =>
{
o.Data = "test";
});
var monitor = services.BuildServiceProvider()
.GetService<IOptionsMonitor<MyOptionsClass>>();
//note: Configure gets called on .Get
var myOptions = monitor.Get("optionalOptionsName");
__________________________________________________________________________________________
【.NET Core】使用autofac实现AOP拦截 记录所有执行方法
https://blog.csdn.net/weixin_38211198/article/details/105925821
__________________________________________________________________________________________
jprofiler监听远程linux上的tomcat
https://blog.csdn.net/Mr_rain/article/details/78902010?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-19.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-19.not_use_machine_learn_pai
__________________________________________________________________________________________