会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
PrintY
天再高又如何,踮起脚我就能靠近太阳!
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
6
7
8
9
10
11
12
13
14
···
19
下一页
2022年1月27日
IIS 禁止自动回收
摘要: 这个也是我在部署.NET 6 hangfire的需求,正常web网站不需要设置。 其中“固定时间间隔”是必须设置的,要不每天都会自动回收。
阅读全文
posted @ 2022-01-27 09:16 PrintY
阅读(1029)
评论(0)
推荐(0)
2022年1月15日
.NET6 Hangfire
摘要: .NET6 MVC项目(其它类型也可以),最简单的步骤运行hangfire,据说支持分布式,等回头再研究下。 1、NuGet安装包 2、Program.cs文件 services.AddHangfire(configura => { configura.UseStorage(new MemorySt
阅读全文
posted @ 2022-01-15 17:42 PrintY
阅读(1379)
评论(0)
推荐(0)
2022年1月11日
sql语句增加列
摘要: --插入不可为空INT类型,并赋默认值 ALTER TABLE [dbo].[Y.UserInfo] ADD UserId INT NOT NULL Default 0; --插入可为空INT类型 ALTER TABLE [dbo].[Y.UserInfo] ADD IsEmail INT NULL
阅读全文
posted @ 2022-01-11 17:20 PrintY
阅读(514)
评论(0)
推荐(0)
2021年12月13日
开发环境 测试环境 生产环境
摘要: 开发环境(development):开发环境是程序猿们专门用于开发的服务器,配置可以比较随意, 为了开发调试方便,一般打开全部错误报告。(程序员接到需求后,开始写代码,开发,运行程序,看看程序有没有达到预期的功能;) 测试环境(testing):一般是克隆一份生产环境的配置,一个程序在测试环境工作不
阅读全文
posted @ 2021-12-13 17:22 PrintY
阅读(386)
评论(0)
推荐(0)
2021年12月9日
.NET6 WebApi 解决跨域问题
摘要: Program.cs var corsPolicyName = "_myAllowSpecificOrigins"; builder.Services.AddCors(options => { options.AddPolicy(name: corsPolicyName, builder => {
阅读全文
posted @ 2021-12-09 14:23 PrintY
阅读(1924)
评论(0)
推荐(0)
.NET6 WebApi JSON传到前台默认变成小驼峰
摘要: C#中语法,model中属性默认都是大驼峰,但是.NET6 WebAPI默认出传到前台自动转化成小驼峰写法,如果要避免这个问题,处理也比较简单~ Program.cs builder.Services.AddControllers() .AddJsonOptions(options => { opt
阅读全文
posted @ 2021-12-09 14:21 PrintY
阅读(1010)
评论(1)
推荐(0)
.NET6 WebApi 获取访问者IP地址
摘要: Program.cs文件中 //获取IP使用 builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); Controller中 private readonly IHttpContextAccessor h
阅读全文
posted @ 2021-12-09 14:15 PrintY
阅读(825)
评论(0)
推荐(0)
.NET6 WebApi 使用 log4net
摘要: 1、安装依赖 Microsoft.Extensions.Logging.Log4Net.AspNetCore 2、配置文件 <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- This section contains the l
阅读全文
posted @ 2021-12-09 14:11 PrintY
阅读(813)
评论(0)
推荐(0)
.NET6 WebAPI 自定义过滤器
摘要: 1、上代码 /// <summary> /// API白名单过滤器 /// </summary> public class APIFilter : ActionFilterAttribute { /// <summary> /// 控制器中加了该属性的方法中代码执行之前该方法。 /// 所以可以用做
阅读全文
posted @ 2021-12-09 14:03 PrintY
阅读(898)
评论(0)
推荐(0)
2021年12月8日
.NET6 部署到 IIS
摘要: 1、下载.net6 运行时以及host支持 https://dotnet.microsoft.com/download/dotnet/6.0 2、IIS 没说什么特别的,绑定域名端口,然后设置IIS应用程序池到“无托管”
阅读全文
posted @ 2021-12-08 15:23 PrintY
阅读(3864)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
13
14
···
19
下一页
公告