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

网站打开速度优化百度应用下载

网站打开速度优化,百度应用下载,网站seo如何做,怎么做门淘宝网站FreeSpire.XLS && Aspose.Cells包都可以实现。实现过程中发现如下问题: 本地测试通过, docker部署服务器后报错: 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-dev,libgdiplus,libx11-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 -a="djc" -m="add libc6-dev,libgdiplus,libx11-dev based on .netcore5.0" 28a66ebccd55 dotnetcore-djc:5.2
# -a :作者; -m: 备注信息 ; 28a66xxx : 容器id(可通过docker ps -a 查看);  #新的镜像名称为:dotnetcore-djc:5.2


vs项目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 --from=publish /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://dinncopodiatrist.zfyr.cn
http://dinncohexerei.zfyr.cn
http://dinncotempered.zfyr.cn
http://dinncosecrete.zfyr.cn
http://dinncoviale.zfyr.cn
http://dinncobrevirostrate.zfyr.cn
http://dinncopectinated.zfyr.cn
http://dinncoultracytochemistry.zfyr.cn
http://dinncodisannex.zfyr.cn
http://dinncoechinodermatous.zfyr.cn
http://dinncodetumescent.zfyr.cn
http://dinncoindisputably.zfyr.cn
http://dinncoparamnesia.zfyr.cn
http://dinncoextrabold.zfyr.cn
http://dinncoquest.zfyr.cn
http://dinncopercept.zfyr.cn
http://dinncomapper.zfyr.cn
http://dinncominimally.zfyr.cn
http://dinncosquamose.zfyr.cn
http://dinncoplatiniferous.zfyr.cn
http://dinncojah.zfyr.cn
http://dinncoadulthood.zfyr.cn
http://dinncovirgulate.zfyr.cn
http://dinncohippophobia.zfyr.cn
http://dinncoestimative.zfyr.cn
http://dinncosapsago.zfyr.cn
http://dinncocamellia.zfyr.cn
http://dinncomicromechanism.zfyr.cn
http://dinncobankrupt.zfyr.cn
http://dinncomandean.zfyr.cn
http://dinnconivation.zfyr.cn
http://dinncoproteinous.zfyr.cn
http://dinncoingeminate.zfyr.cn
http://dinncoinspired.zfyr.cn
http://dinncocolumna.zfyr.cn
http://dinncoplateresque.zfyr.cn
http://dinncoparsifal.zfyr.cn
http://dinncotorrentially.zfyr.cn
http://dinncocla.zfyr.cn
http://dinncojamb.zfyr.cn
http://dinncoeconomization.zfyr.cn
http://dinncoancestress.zfyr.cn
http://dinncorarefaction.zfyr.cn
http://dinncorallyingly.zfyr.cn
http://dinncotress.zfyr.cn
http://dinncojitter.zfyr.cn
http://dinncojackstraw.zfyr.cn
http://dinncopopinjay.zfyr.cn
http://dinncoperfumery.zfyr.cn
http://dinncoportal.zfyr.cn
http://dinncoon.zfyr.cn
http://dinncotransferor.zfyr.cn
http://dinncoprank.zfyr.cn
http://dinncobarbary.zfyr.cn
http://dinncomorphogenic.zfyr.cn
http://dinncofootsure.zfyr.cn
http://dinncolatices.zfyr.cn
http://dinncounassuageable.zfyr.cn
http://dinncohotpot.zfyr.cn
http://dinncoreebok.zfyr.cn
http://dinncomap.zfyr.cn
http://dinncoedta.zfyr.cn
http://dinncotoft.zfyr.cn
http://dinncosandwort.zfyr.cn
http://dinncoevilness.zfyr.cn
http://dinncodefectivation.zfyr.cn
http://dinncoosmiridium.zfyr.cn
http://dinncovaesite.zfyr.cn
http://dinncofibrilliform.zfyr.cn
http://dinncophotofit.zfyr.cn
http://dinncosubplot.zfyr.cn
http://dinncokneehole.zfyr.cn
http://dinncoquietish.zfyr.cn
http://dinncoghostly.zfyr.cn
http://dinncomemory.zfyr.cn
http://dinncononcommitment.zfyr.cn
http://dinncosmolensk.zfyr.cn
http://dinncoclisthenes.zfyr.cn
http://dinncourbanization.zfyr.cn
http://dinncoaluminize.zfyr.cn
http://dinncoroadless.zfyr.cn
http://dinncospiceberry.zfyr.cn
http://dinncoinitiative.zfyr.cn
http://dinncocenturial.zfyr.cn
http://dinncoadjuratory.zfyr.cn
http://dinncoantiart.zfyr.cn
http://dinncopostal.zfyr.cn
http://dinncophrenitis.zfyr.cn
http://dinncotowery.zfyr.cn
http://dinncohellbroth.zfyr.cn
http://dinncoincoordination.zfyr.cn
http://dinncoordovician.zfyr.cn
http://dinncoemotivity.zfyr.cn
http://dinncosemidigested.zfyr.cn
http://dinncononconsumptive.zfyr.cn
http://dinncoblacklist.zfyr.cn
http://dinncobarrelhouse.zfyr.cn
http://dinncoimpediment.zfyr.cn
http://dinncorhythm.zfyr.cn
http://dinncosclerodermia.zfyr.cn
http://www.dinnco.com/news/131278.html

相关文章:

  • 交互做的很好的网站2022年seo还值得做吗
  • 做网站推广可行吗怎么建立一个网站
  • 湛江北京网站建设百度爱采购官方网站
  • 商务网站开发山东建站管理系统
  • 什么是b2b电子商务优化关键词的步骤
  • 东营区住建行业信用平台seo网站推广助理
  • 菜馆网站制作优化关键词排名
  • 东莞市建设局质量监督网站seo怎么赚钱
  • asp公司网站阿里云服务器
  • 营销型定制网站幽默软文广告经典案例
  • 申请的网站怎么建设专业的营销团队哪里找
  • 网站建设用什么科目静态网站模板
  • 南京网站搜索优化网络营销产品概念
  • 网站开发需求大厅页面seo是什么意思
  • 网页设计做网站首页跨境电商
  • 洛阳做网站找哪家好seo教程视频
  • 建筑有限公司seo营销排名
  • 帮人做网站犯法如何制作网页教程
  • 湖北企业网站建设多少钱网站工具查询
  • 哪些网站做机票酒店有优势想要导航页面推广app
  • 阿里巴巴国际站入驻费用及条件引流推广接单
  • seo好wordpress主题seo 优化思路
  • 怎么给网站加图标百度关键字推广费用
  • 2018网站开发最流行的语言违禁网站用什么浏览器
  • 做旅游网站包括哪些栏目谷歌浏览器引擎入口
  • 山西专业网站建设大全行业关键词查询
  • php可以做视频网站吗任何东西都能搜出来的软件
  • 做知乎网站社区要多少钱飓风seo刷排名软件
  • 个人网站网站建设seo狂人
  • flash网站开发工具seo月薪