随笔分类 - .net Core 3.1
c#笔记
记一次.Net Core通过GDI+在CentOS 7(Docker)环境中绘图报错The type initializer for 'Gdip' threw an exception的问题及处理方式
摘要:一、前言 今天在AspNetCore3.1环境中做了一个用户登录页面,在登录页面中有一个功能就是需要后端动态绘制一个验证码图片,防止前端通过机器或爬虫工具模拟自动登录。在开发机器上(windows10)调试正常,但是部署到centos7容器(容器基础环境mcr.microsoft.com/dotne
阅读全文
摘要:.NET core 3.1 解决方法:在Startup.cs中配置跨域 先引用Nuget包:Microsoft.AspNet.WebApi.Cors 然后在ConfigureServices方法中新增下面语句: public void ConfigureServices(IServiceCollec
阅读全文