【发布时间】:2017-04-29 11:02:51
【问题描述】:
我检查了互联网上与配置系统相关的所有解决方案未能初始化异常,但没有一个对我有用。 所以我发布了这个问题。
我正在使用 winform c# 处理 PayPal REST API。我自定义了我的 app.config 文件。当我重建应用程序时它显示Configuration system failed to initialize
这是默认 app.config 代码:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
这是我的自定义 app.config 代码:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<configSections>
<section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
</configSections>
<!--PayPal SDK settings-->
<paypal>
<settings>
<add name="mode" value="sandbox" />
<add name="clientId" value="__CLIENT_ID__" />
<add name="clientSecret" value="__CLIENT_SECRET__" />
</settings>
</paypal>
</configuration>
编辑:
我使用try catch块来捕获异常,否则程序不会终止而是工作异常。我的调用堆栈是空的。我在表单加载时使用了 try catch。
【问题讨论】:
-
堆栈跟踪怎么样?内部异常是否提供更多信息?
-
基本上我使用try catch块来捕获异常,否则程序不会终止但工作异常。我的调用堆栈是空的。
-
@PaoloTedesco 我在表单加载时使用了 try catch。
标签: c# winforms paypal app-config