簡體   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