netcore webapi 输出imges,在docker里面swagger报错
2020-12-28 21:27
标签:install 报错 webapi cat info qrcode format pixel turn 发现:service中有个webapi输出了: 在IIS里面正常,但是在docker里面就报错。 IIS里面swagger中显示该方法返回的是: 然后在dockerfile中加入: netcore webapi 输出imges,在docker里面swagger报错 标签:install 报错 webapi cat info qrcode format pixel turn 原文地址:https://www.cnblogs.com/25miao/p/13305011.htmlpublic Bitmap GetLogoQRCode(string url, string logoPath, int pixel)
{
return QRCoderHelper.GetLogoQRCode(url, logoPath, pixel);
}
"System.Drawing.Bitmap"
-------------
暂时改为:public FileResult GetPTQRCode(QRCoderDto dto)
{
try
{
var bitmap = QRCoderHelper.GetPTQRCode(dto.Url, dto.Pixel);
MemoryStream ms = new MemoryStream();
bitmap.Save(ms, ImageFormat.Jpeg);
return new FileContentResult(ms.ToArray(), "image/png");
}
catch (Exception)
{
throw new UserFriendlyException("二维码生成异常,请检查");
}
}
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
RUN echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
RUN echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
RUN echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
RUN apt-get update -y
RUN apt-get install libgdiplus
文章标题:netcore webapi 输出imges,在docker里面swagger报错
文章链接:http://soscw.com/index.php/essay/38915.html