当前位置: 首页 > news >正文

网站乱码网站开发原型模板

网站乱码,网站开发原型模板,百度应用中心,地方门户网站的推广FreeSpire.XLS Aspose.Cells包都可以实现。实现过程中发现如下问题#xff1a; 本地测试通过#xff0c; docker部署服务器后报错#xff1a; The type initializer for Spire.Xls.Core.Spreadsheet.XlsPageSetupBase threw an exception. 由于缺少依赖#xf…FreeSpire.XLS Aspose.Cells包都可以实现。实现过程中发现如下问题 本地测试通过 docker部署服务器后报错 The type initializer for Spire.Xls.Core.Spreadsheet.XlsPageSetupBase threw an exception. 由于缺少依赖 libc6-devlibgdipluslibx11-dev。由于目标服务器为内网环境无外网环境。官网给出答案在dockerfile中 增加 RUN apt-get update \ apt-get install -y --allow-unauthenticated \ libc6-dev \  libgdiplus \ libx11-dev \   rm -rf /var/lib/apt/lists/* 尝试解决 创建docker镜像。由于项目已 mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim 为基础镜像以此新建一个环境镜像。 # 进入容器部署环境 docker run -it mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim /bin/bash apt-get update \ apt-get install -y --allow-unauthenticated \ libc6-dev \ libgdiplus \ libx11-dev \ rm -rf /var/lib/apt/lists/*#部署成功后 退出容器并将容器打包为新镜像。 docker commit -adjc -madd libc6-dev,libgdiplus,libx11-dev based on .netcore5.0 28a66ebccd55 dotnetcore-djc:5.2 # -a :作者 -m: 备注信息 28a66xxx : 容器id可通过docker ps -a 查看 #新的镜像名称为dotnetcore-djc:5.2vs项目dockerfile中修改基础镜像FROM dotnetcore-djc:5.2 AS base 发布后又报错System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception. google后发现 libgdiplus 包使用了 System.Drawing.Common .net6后仅在window上支持我目前使用.net5, 也是平台兼容性报错不知为何。 尝试解决 在项目中添加如下代码 AppContext.SetSwitch(System.Drawing.EnableUnixSupport, true); 发布后又报错Index was out of range. Must be non-negative and less than the size of the collection. (Parameter index) 尝试解决 升级 FreeSpire.XLS 包 由原来的 10.10.0 升级为 12.7.0 导出图片后发现中文字体乱码。 尝试解决 #将window中 C:\Windows\fonts 内需要得字体拷贝至容器内 /usr/share/fonts/windows文件夹内。 #更改字体库的权限 chmod 755 /usr/share/fonts/windows/*#进入文件夹内 mkfontscale  //字体扩展 mkfontdir  //新增字体目录 fc-cache-fv  //刷新缓存#肯定会报错mkfontscale: command not found 等 # 由于Docker mcr.microsoft.com/dotnet/aspnet:5.0 基础镜像中不包含该包需手动安装。 apt-get update apt-get upgrade  apt-get install ttf-mscorefonts-installer // 安装mkfontscale  mkfontdir  命令#报错 package ttf-mscorefonts-intaller has no installation candidate 错误。 #由于系统初始的资源库找不到指定的包需要更新 对应 的镜像地址。 #我的/etc/apt/sources.list 中 初始镜像地址为 Debian buster  所以添加如下镜像至sources.list中。 #如果添加版本错误的话update 会报错。 #华为云 deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-freedeb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free #中科大 deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-freedeb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free# 添加后刷新 apt-get update apt-get upgrade  apt-get install ttf-mscorefonts-installer // 安装mkfontscale  mkfontdir  命令 apt-get install fontconfig //安装 fc-cache 命令 修改 .sln 同目录下的Dockerfile文件内容如下 #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.#这种模式是直接在构建镜像的内部编译发布dotnet项目。 #注意下容器内输出端口是9291 #如果你想先手动dotnet build成可执行的二进制文件然后再构建镜像请看.Api层下的dockerfile。FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim AS base WORKDIR /app EXPOSE 80FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build WORKDIR /src COPY [ShutterPro.Core.Api/ShutterPro.Core.Api.csproj, ShutterPro.Core.Api/] COPY [ShutterPro.Core.Extensions/ShutterPro.Core.Extensions.csproj, ShutterPro.Core.Extensions/] COPY [ShutterPro.Core.Tasks/ShutterPro.Core.Tasks.csproj, ShutterPro.Core.Tasks/] COPY [ShutterPro.Core.IServices/ShutterPro.Core.IServices.csproj, ShutterPro.Core.IServices/] COPY [ShutterPro.Core.Model/ShutterPro.Core.Model.csproj, ShutterPro.Core.Model/] COPY [ShutterPro.Core.Common/ShutterPro.Core.Common.csproj, ShutterPro.Core.Common/] COPY [ShutterPro.Core.Services/ShutterPro.Core.Services.csproj, ShutterPro.Core.Services/] COPY [ShutterPro.Core.Repository/ShutterPro.Core.Repository.csproj, ShutterPro.Core.Repository/] COPY [ShutterPro.Core.EventBus/ShutterPro.Core.EventBus.csproj, ShutterPro.Core.EventBus/] RUN dotnet restore ShutterPro.Core.Api/ShutterPro.Core.Api.csproj COPY . . WORKDIR /src/ShutterPro.Core.Api RUN dotnet build ShutterPro.Core.Api.csproj -c Release -o /app/buildFROM build AS publish RUN dotnet publish ShutterPro.Core.Api.csproj -c Release -o /app/publishFROM base AS final WORKDIR /app COPY --frompublish /app/publish . EXPOSE 9291 ENTRYPOINT [dotnet, ShutterPro.Core.Api.dll]RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak \mv sources.list /etc/apt/ \apt-get update -y \apt-get install -y --allow-unauthenticated libc6-dev libgdiplus libx11-dev fonts-wqy-zenhei ttf-mscorefonts-installer fontconfig \apt-get clean \ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll 同目录下新增一个  sources.list 文件内容如下 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-freedeb https://security.debian.org/debian-security bullseye-security main contrib non-free # deb-src https://security.debian.org/debian-security bullseye-security main contrib non-free 重新部署后一切正常。 参考 [1]: https://www.e-iceblue.com/forum/exception-the-type-initializer-for-spire-xls-core-spreadsh-t10260.html [2]: https://docs.telerik.com/reporting/knowledge-base/system-drawing-common-is-not-supported-on-non-windows-platforms [3]: https://www.lllxy.net/Blog/Detail/634b2769-5046-45eb-b71b-fe2a87b7c1fe
http://www.dnsts.com.cn/news/11629.html

相关文章:

  • 泰州网站建设多少钱展览网站建设方案
  • 网站关键词排名没有了网页设计学校模板
  • 2022中文无字幕入口网站中国大规模建设合肥
  • 贵州建设厅网站办事大厅深圳住建局官方网站
  • 网站建设的未来海报设计论文
  • 现在建设的网站有什么劣势手机微网站怎么设计方案
  • 网站域名备案需要多长时间one dirve做网站
  • 皮卡剧网站怎样做wordpress 站点身份
  • 网站 关键词汽车之家网页版官网
  • 响应式网站建设好么舆情分析软件
  • 电子商务网站建设有什么认识农村自建房设计图120平方二层
  • 淘宝客网站建站源码禅城网站建设企业
  • 网站开发需要用到哪些设备做网站备案需要多长时间
  • 域名绑定网站需要多久获取排名
  • 天津七七一网站建设有限公司怎么样西安那里做网站
  • 网站项目报价单模板里水网站开发
  • 青梦建站杭州新网站建设方案
  • 怎么做百度网站免费的网站建设的优势是什么意思
  • 徐州网站定制站群wordpress
  • 企业免费建站网站毕设做购物网站系统的原因
  • 58同城建网站怎么做查询域名官网的是那个网站吗
  • 和各大网站做视频的工作能够做网站的资质
  • 湘潭营销型网站建设网页源代码是什么
  • 江苏网站备案要求电商网站开发发展和前景
  • 塘沽企业网站建设网络品牌推广方法
  • 手机网站建设网站报价河北秦皇岛建设局网站
  • 门户网站的细分模式有网站外链
  • 企业网站建设维护合同书建设摩托车官网商城2015
  • ui做交互式网站吗注册城乡规划师有什么用
  • 如何线上推广引流宁波品牌网站推广优化公司