繁体   English   中英

使用cete.dynamicpdf和配置文件中的条目appsettings在运行时C#exe中的异常

[英]Exception in c# exe at runtime using cete.dynamicpdf and an entry appsettings in config file

我已经从前同事那里继承了ac#exe应用程序。 我们将此exe作为批处理使用,由另一个应用程序调用(并通过命令行进行测试和调试)。 在其app.config中,我仅看到Log4Net的配置(也在参考中出现)。

该应用程序使用ceTE.DynamicPDF.40。

我想在app.config中插入键值设置,以进行某些配置。 我使用应用程序的任何元素都会在运行时引发异常。 从来没有做过。

中断的行是:

Document document = new Document();

异常信息是(翻译的):

ex.Source --> ceTe.DynamicPDF.40
ex.Message --> The type initializer for 'ceTe.DynamicPDF.Document' threw an exception.
ex.StackTrace -->in ceTe.DynamicPDF.Document..ctor() in BatchStampaRegistroDeleghe.BusinessLogic.BusinessManager.GestioneCover (String & Path, List`1 args, Int32 Startpage, String Sectional) in C: \ ... \ BusinessManager.cs: line 779
ex.InnerException.Source --> System.Configuration
ex.InnerException.Message --> Unable to initialize the configuration system
ex.InnerException.StackTrace --> in System.Configuration.ConfigurationManager.PrepareConfigSystem () in System.Configuration.ConfigurationManager.get_AppSettings () in ceTe.DynamicPDF.Document..cctor ()

如果我从app.config中删除该条目,则该exe可以恢复工作。

以前有人遇到过类似的问题吗? 提前感谢任何建议。

ceTe.DynamicPDF.40.dll读取app.config文件以查看是否存在任何许可证密钥。 如果找到许可证密钥,它将应用许可证密钥删除PDF上的水印。

根据您发布的信息,看来ceTe.DynamicPDF.40.dll由于对其进行了更改而无法读取app.config文件。 错误“无法初始化配置系统”通常表示app.config中的条目无效或位置不正确的问题。 请仔细检查要添加到app.config的新设置的语法,并确保将它们添加到正确的位置。

免责声明:我在ceTe Software工作,该公司开发DynamicPDF库。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM