我从一个前大学继承了一个c# 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将返回工作状态。
以前也有类似的问题吗?请提前接受任何建议。
发布于 2016-11-07 16:07:35
动态PDF.40.dll读取app.config文件以查看是否存在许可密钥。如果找到许可证密钥,它将应用许可证密钥来删除PDF上的水印。
根据您发布的信息,似乎ceTe.DynamicPDF.40.dll无法读取app.config文件,因为对它所做的更改。“无法初始化配置系统”的错误通常表示app.config中存在无效或不正确的条目问题。请再次检查要添加到app.config中的新设置的语法,并确保它们被添加到正确的位置。
免责声明:我在ceTe软件公司工作,该公司开发DynamicPDF库。
https://stackoverflow.com/questions/40466417
复制相似问题