随笔分类 - .netcore
摘要:.NETCORE异常捕获的管道实现方式(中间件) 一,中间件实现 using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspN
阅读全文
摘要:在Startup中,我们看官网可以知道Configuration是注入服务和Configure配置管道,而我们的实现原理是在管道中直接返回HellowWorld,新建一个.netcoreMVC项目 一,第一种方法,最简单,我们直接在管道实现,在Configure添加一个直接返回的配置,如下代码 pu
阅读全文
摘要:一,如下图 二,构建好框架,将不必要的包删掉 三,添加路由 app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index
阅读全文
摘要:一,我们新建.NET Core 3.0的API项目 二,neget包Swashbuckle.AspNetCore 三,修改Startup文件 public void ConfigureServices(IServiceCollection services) { services.AddContro
阅读全文
摘要:一,新建.netcore控制台应用程序。本文使用.netcore2.2版本,结构如下 二,negut引用Topshelf.Log4Net,Topshelf 三,代码如下:1>Program.cs 2>ServiceHandler.cs 3>log4net.config 四,发布项目配置 五,生成成功
阅读全文

浙公网安备 33010602011771号