![](https://img-blog.csdnimg.cn/8c2dc1768dad4521bc27b2e923a40bc2.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
C#
C#语言。
雪靡
ACMer一名。
Github地址:https://github.com/nayaku
展开
-
NET7 publish 独立部署模式后出现Could not load file or assembly xxx Version=7.0.0.0 错误
由于现在运行时升级到了7.0.4,但是打包发布出来的项目引用的还是7.0.0的程序集,所以出现无法加载的情况。此外发现NET5等之类也有这种错误,目前看来dotnet publish还是不太可靠。最后publish之后,则可以正常运行。在发布的配置文件*.pubxml中添加。原创 2023-04-05 10:45:23 · 734 阅读 · 1 评论 -
net5 failed to load the dll from [C:\Users\ZMK\Desktop\publish\coreclr.dll] HRESULT 0x80070057
解决方案:https://developercommunity.visualstudio.com/content/problem/805039/net-core-30-failed-to-load-dll.html需要下载KB2533623 补丁。下载地址:http://www.3h3.com/soft/119473.html原创 2020-12-04 17:22:22 · 1954 阅读 · 0 评论 -
ComRegisterFunctionAttribute
ComRegisterFunctionAttribute 使你能够添加任意注册代码以满足 COM 客户端的要求。 例如,你可以使用命名空间中的注册函数更新注册表 Microsoft.Win32 。 如果提供了注册方法,还应将应用 System.Runtime.InteropServices.ComUnregisterFunctionAttribute 于注销方法,这会反转注册方法中完成的操作。.NET Framework: 公共语言运行时使用此属性调用方法,方法是将其包含的程序集注册 (直接或间接) 使用原创 2020-12-02 10:10:55 · 466 阅读 · 0 评论 -
C# linq的Take和Skip存在先后顺序
原语句为var q = _list.AsParallel().WithCancellation(tokenSource.Token).Where(item => item.IsBeginWith(syllables)).OrderByDescending(item => item.Syllables.Length).ThenByDescending(item => item.Frequency).Take(num).Skip(skip);linq的Take和Skip存在先后顺序。如果这样原创 2021-01-21 15:46:27 · 663 阅读 · 0 评论 -
CA1416警告:平台兼容性问题
来源:https://docs.microsoft.com/zh-cn/dotnet/core/compatibility/code-analysis/5.0/ca1416-platform-compatibility-analyzer.NET code analyzer rule CA1416 is enabled, by default, starting in .NET 5.0. It produces a build warning for calls to platform-specific原创 2020-12-02 10:09:54 · 2786 阅读 · 0 评论 -
C#用BinaryWriter写入String的时候,前面会多出一个字符或者乱码的问题
BinaryWriter在字符串前面写入一个字节或者两个字节,用来记录字符串的字节长度。参考:BinaryWriter.Write 方法 (System.IO) | Microsoft Docshttps://docs.microsoft.com/zh-cn/dotnet/api/system.io.binarywriter.write?redirectedfrom=MSDN&view=netframework-4.8#System_IO_BinaryWriter_Write_System.原创 2021-03-18 22:15:01 · 694 阅读 · 0 评论