首页 > 编程语言 >C# 使用QuestPDF各种报错,System.IO.FileNotFoundException:“未能加载文件或程序集,DllNotFoundException: 无法加载 DLL“QuestPd

C# 使用QuestPDF各种报错,System.IO.FileNotFoundException:“未能加载文件或程序集,DllNotFoundException: 无法加载 DLL“QuestPd

时间:2024-05-11 18:08:24浏览次数:17  
标签:QuestPdfSkia license 报错 QuestPDF framework4.8 net 加载

最近要做一个生成pdf报告的小功能,搜索一番之后,选择了QuestPDF这个库

由于我是要在net framework4.8中实现功能,可能使用场景太老了,导致使用过程一波三折,非常的坎坷,折腾了一下午,增长了一些经验,记录下来

1,如果你要在net framework4.8框架中使用,就不要自作聪明的用netstandard2.0框架来实现业务,本来以为netstandard2.0可以被net framework4.8中调用,也可以被net6调用,就想着心代码尽量写在netstandard2.0中,结果悲剧了,编译正常,但是dll根本就拷贝不过去,运行程序,直接报错 System.IO.FileNotFoundException:“未能加载文件或程序集...

2,老老实实在net framework4.8类库中引用QuestPDF,实现业务,结果又报错了,一大串,

System.Exception:“QuestPDF is a modern open-source library. We identify the importance of the library in your projects and therefore want to make sure you can safely and confidently continue the development. Being a healthy and growing community is the primary goal that motivates us to pursue professionalism.

Please refer to the QuestPDF License and Pricing webpage for more details. (https://www.questpdf.com/license/)

If you are an existing QuestPDF user and for any reason cannot update, you can stay with the 2022.12.X release with the extended quality support but without any new features, improvements, or optimizations. That release will always be available under the MIT license, free for commercial usage. We are planning to sunset support for the 2022.12.X branch around Q1 2024. Until then, it will continue to receive quality and bug-fix updates.

The library does not require any license key. We trust our users, and therefore the process is simple. To disable license validation and turn off this exception, please configure an eligible license using the QuestPDF.Settings.License API, for example:

"QuestPDF.Settings.License = LicenseType.Community;"

Learn more on: https://www.questpdf.com/license/configuration.html

这是因为授权许可的问题,这个库默认开启许可证验证,需要手动指定一下使用场景,只需要在使用前加上QuestPDF.Settings.License = LicenseType.Community这段代码就行了

3,指定了许可证后,还是报错,DllNotFoundException: 无法加载 DLL“QuestPdfSkia”: 找不到指定的模块...,这是因为应用程序生成的时候默认勾选了“首选32位”,只需要右键net framework4.8应用程序》生成》常规》首选32位,把勾选去掉就行了

 

标签:QuestPdfSkia,license,报错,QuestPDF,framework4.8,net,加载
From: https://www.cnblogs.com/luludongxu/p/18186979

相关文章

  • windows安装metasploit,运行报错处理
    最近给几个windows11的系统安装了metasploit,其中有几个在启动msf时报错D:/metasploit-framework/embedded/framework/1ib/net/dns/resolver.rb:345:in'nameservers=':String,Wrongarguentformat,neitherString,ArraynorIPAddr(ResolverArgumentError)看起来像是dn......
  • Git -- 修改git账号密码后,进行git提交时报错
    修改git账号密码后,进行git提交时报错$gitpushorigindevelopremote:HTTPBasic:Accessdeniedfatal:Authenticationfailedfor'http://xxx/web.git/'重新设置下git信息gitconfig--globaluser.name"yourname"gitconfig--globaluser.email"your......
  • JVM类加载器ClassLoader源码剖析
    在JVM类加载器分类中通过ClassLoader获取了不同类型的类加载器,它是如此之重要那么ClassLoader究竟为何物呢?通过源码分析(以jdk17示例):调试跟踪ClassLoader:......
  • Python-PostgreSQL主键自动填充报错:SAWarning: Column x is marked as a member of th
    importdatetimefromsqlalchemyimportColumn,String,inspect,Integerfromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlalchemy.ormimportsessionmakerfromsqlalchemyimportcreate_engineengine=create_engine(DATABASE_URL)Base=decla......
  • BCEL:加载恶意类
    直入主题为啥要用BCEL?因为范围广,如下JDK内置类(JDK<8u251)Tomcat中相关依赖:Tomcat7org.apache.tomcat.dbcp.dbcp.BasicDataSourceTomcat8及以后org.apache.tomcat.dbcp.dbcp2.BasicDataSourcecom.sun.org.apache.bcel.internal.util.ClassLoader重写了默认的类加载方法......
  • 面向单片机的超轻量级的神经网络推理库+单片机上实现动态加载功能的函数库
    1、TinyMaix-面向单片机的超轻量级的神经网络推理库TinyMaix是专为低资源的单片机设计的AI神经网络推理框架,通常被称为TinyML。TinyMaix可以让你在任意单片机上运行轻量级深度学习模型。TinyMaix的设计原则:易用性>移植性>速度>空间。TinyMaix其实是矽速科技(Sipee......
  • [idea]mvn install没有问题,idea build报错程序包com.alibaba.fastjson不存在
    现象:1、mvninstall没有问题2、ideabuild报错程序包com.alibaba.fastjson不存在3、File->Settings->Build,Execution,Deployment->Compiler自动编译选项也是勾选的解决:1、委托maven构建和运行,确实能执行;但是运行都要执行maveninstall,速度慢 -- 不推荐 2、在......
  • wps加载项在vue2项目中的应用(publish模式)
    wps加载项在vue2项目中的应用应用代码:wps.js/***WPSOA助手-WPS启动方法入口*/varpluginsMode=location.search.split("=")[1];//截取url中的参数值varpluginType=WpsInvoke.ClientType.wps;//加载项类型wps,et,wppvarpluginName="WpsOAAssist";//加载项名......
  • kapt构建报错
    报错信息:Causedby:org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException:Couldnotfindmethodkapt()forarguments[android.arch.persistence.room:compiler:1.1.1]onobjectoftypeorg.gradle.api.internal.artifacts.dsl.de......
  • 报错
    {"cainfo":"1","dev_no":"1","dev_safe_info":"1","fixmedins_code":"H53040300191","fixmedins_name":"玉溪市江川区江城镇中心卫生院","inf_time":"2024-05-1011:5......