![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.net
hubaxiaofeiyu
上海理工大学
展开
-
C# Except comparer 使用小结
C# list Except Comparer原创 2022-03-07 10:56:37 · 1227 阅读 · 0 评论 -
C# 依赖dll 嵌在exe内
C# 依赖dll 嵌在exe内原创 2022-02-17 16:10:43 · 820 阅读 · 0 评论 -
IIS 简单站点发布
1.进入IIS 管理器,先进行添加网站2.原创 2021-12-30 18:09:27 · 542 阅读 · 0 评论 -
C# 矩阵运算求逆 转置
static void Main(string[] args){double[,] matrix = new double[4,4]{{ 1, 0, 0, 0 },{ 0, 1, 0, 0 },{ 0, 0, 1, 0 },{ -139, -163, 0.9, 1 },}; var str = "1,0,0,0,0,1,0,0,0,0,1,0,-139,-163,0.9,1"; var matrix1 = ConvertStringToTwoArray(str原创 2021-11-23 10:26:35 · 343 阅读 · 0 评论 -
安装了windows 服务,在服务列表里找不到服务的解决办法
安装了windows 服务,在服务列表里找不到服务的解决办法当我们安装了windows 服务,一般在任务管理器中的服务或者是服务界面是可以看到相应的服务的今天遇到服务安装了,但是在服务列表中却找不到该服务的现象,服务重装了,电脑也重启了,依然是显示不了,尝试在cmd 窗口重启该服务在 CMD 窗口中重启该服务// 重启服务net start ServiceName发现该服务已经启动了在 CMD 窗口中查找该服务// 查找服务sc query |findstr "ServiceName"原创 2021-09-13 11:16:38 · 6000 阅读 · 1 评论 -
’abp‘不是内部或外部命令,也不是可运行的程序 或批处理文件的解决办法
’abp‘不是内部或外部命令,也不是可运行的程序 或批处理文件这种问题 是老生常谈的问题啦,一般是环境变量没有设置在装好dotnet 后,安装Abp.Clidotnet tool install -g Volo.Abp.Cli如果已经装好,需要更新的话执行dotnet tool update -g Volo.Abp.Cli完成安装后,把对应的安装路径放到环境变量中C:\Users\uername.dotnet\tools在cmd 窗口输入abp ,可以看到版本信息啦...原创 2021-09-10 18:03:53 · 1617 阅读 · 0 评论 -
C# List AddRange Concat Value cannot be null. (Parameter ‘collection‘)
C# List AddRange Concat Value cannot be null. (Parameter ‘collection’)在C# 中两个list进行相加时,经常用到List.AddRange() 或则Concat()的用法如果使用时遇到 Value cannot be null. (Parameter ‘collection’)的异常,说明被添加的list 对象是null有关AddRange 的说明有关Concat 的说明想要避免这个问题,2种解决办法使用AddRang原创 2021-08-20 10:16:34 · 1301 阅读 · 0 评论 -
解决URL 中出现%E2%80%8E
解决URL 中出现%E2%80%8E调用第三方接口时,从内部WIKI 上复制了URL 的地址,直接帖在VS2019 中去使用调试时发现无法获取数据,报404查看拼接的URL是ok的,此时在VS中是看不出来有空格存在的, 通过Swagger 获取数据也是OK 的,尝试把URL 直接放在浏览器里去执行,发现URL 解析出来包含”%E2%80%8E“,尝试找解决方案,把“%E2%80%8E”过滤具体方案如下:通过string.Replace()对“%E2%80%8E” 进行过滤把有问题的URL原创 2021-08-17 16:00:55 · 3278 阅读 · 0 评论 -
ABP There is already an object named ‘AbpAuditLogs‘ in the database
There is already an object named ‘AbpAuditLogs’ in the database在使用ABP做demo 时,生成数据库时,会提示AbpAuditLogs 已经存在此时去数据库查看数据库的数据,发现找不到相应的数据表数据库连接字符串如下:和数据库引用如下:依赖包如下:可以发现我们使用的数据库是SqlServer,由于我本地没有安装SqlServer,用的一直都是PostgreSql, 一直再用PostgreSql 来查询表,所以以为本地删除了,其原创 2021-08-16 20:02:35 · 1072 阅读 · 0 评论 -
C# string.Format常见异常
C# string.Format常见异常Index (zero based) must be greater than or equal to zero and less than the size of the argument list.原创 2021-07-28 17:06:09 · 992 阅读 · 0 评论 -
C# string 和 list contains 使用注意事项
C# string 和 list contains 使用注意事项string 使用containslist 使用containsstring 使用contains string testStr = string.Empty; //此时调用contains 判断是否含有字符串 是没问题的,result 为false var result = testStr.Contains("test"); //此时调用contains 判断是否含有字符 也是没问题的,result 为false res原创 2021-07-18 14:20:53 · 2101 阅读 · 0 评论 -
Index (zero based) must be greater than or equal to zero and less than the size of the argument list
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.在coding 时,遇到了以上错误信息,检查了代码,不出来问题经调试后发现是以下写法导致,// 经常用到string.formatvar ret = string.Format("{0}{1}{2}{3}", "test", "test1", "test2");定义4个变量,实际赋值3个该写法原创 2021-06-29 10:21:21 · 6766 阅读 · 0 评论 -
C# string转enum的泛型转换方法
C# string转enum的泛型转换方法开发中常用到string 到枚举的转换,写了个泛型转换demo// demo internal class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); var ret = StringToEnum<Color>("Red");原创 2021-06-17 11:34:28 · 582 阅读 · 0 评论 -
.net core add-migration requires a primary key to be defined
The entity type ‘BeamLimitingDeviceTolerance’ requires a primary key to be defined. If you intended to use a keyless entity type, call ‘HasNoKey’ in ‘OnModelCreating’. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linki原创 2021-06-17 00:03:54 · 1407 阅读 · 0 评论 -
C# LINQ to Entities 不识别方法
C# Entity使用LINQ的注意事项// 使用LINQ 查询var dbStudent = _dbWrapper.GetEntities<tablestudent>().LastOrDefault(item => item.grade != null && item.grade == 80);此时会报出以下异常"LINQ to Entities 不识别方法“原因是对集合的查询操作会被LINQ编译成SQL语句,此时是无法识别方法的。可以通过以下方式来解决/原创 2021-06-05 10:57:31 · 719 阅读 · 0 评论