在要求输入邮箱的文本域,请填写真实的邮件地址。非真实邮件地址,将收不到回复信息。

2021年12月的内容

Docker

基于dotnet官方的aspnet5的镜像构建安装libgdiplus基础镜像

背景 在.net 5应用中,使用了Excel文件处理,在Docker容器中运行就会出现关于libgdiplus的异常。虽然在Dockerfile中可以使用以下内容解决异常,但是这个速度太慢了。每次构建慢的让人怀疑人生,最重要的是还可能失败。 RUN apt-get update && apt-get install -y libgdiplus libc6-dev && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll 为了提高构建速度,所以使用官方的基础镜像再二次构建一个基础镜像,默认安装 libgdiplus ,这样每次构建速度就会提升好多好多。默认安装了libgdiplus等库,以便支持Excel导入导出 构建基础镜像的Dockerfile Dockerfile ...

2年前 (2021-12-18) 902℃ 0评论 63喜欢

.net core

.NET 5中使用GB2312编码报错的问题

背景 在使用.net 5构建应用时,在处理某些编码问题使用了GB2312,应用运行后报错。经过确认知道了编码 GB2312 默认不支持。 异常信息 Not Support Encoding’GB2312′ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter ‘name’)System.Exception: Not Support Encoding’GB2312′ is not a supported encoding name. For inf...

2年前 (2021-12-17) 567℃ 0评论 3喜欢