【发布时间】:2018-05-17 19:22:26
【问题描述】:
我在 ASP.Net (3.5) 中有一个需要升级的旧应用程序,但是,在更新到 4.5 后,无法识别 web.config 文件中的 configSections 元素并且应用程序无法加载。这里有什么变化吗?
以下曾经工作...
<configuration>
<configSections>
<section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
</configSections>
<!-- PayPal SDK settings -->
<paypal>
<settings>
<add name="mode" value="sandbox"/>
<add name="clientId" value="YOUR APPLICATION CLIENT ID"/>
<add name="clientSecret" value="YOUR APPLICATION CLIENT SECRET"/>
</settings>
</paypal>
</configuration>
但没有快乐
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Source:
22:
23: <configSections>
24: <section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
【问题讨论】:
-
我在 4.6.1 中有一个网站,其中包含
configSections元素。 -
确保您的应用程序池用户对网站目录具有读取权限。还转到 IIS 管理器,在左窗格中选择您的网站,然后双击右窗格中的处理程序图标。如果加载了 http 处理程序列表,则表示 web.config 有效
-
在最近的版本中,您应该使用如下配置部分:
<section name="paypal" type="PayPal.Manager.SDKConfigHandler, PayPalCoreSDK" />。我建议您包含带有错误代码的完整错误消息(例如0x{hex number}),因为该问题将更易于阅读和分析。 -
好的 - 我从带有 IISExpress 的 VisualStudio 2017 运行。我认为这实际上是一个 VS2017 配置问题。我将改为在 IIS 上运行它。
-
Tetsuya - 当您说“最新版本”时,您是什么意思?什么版本?点网?
标签: asp.net paypal web-config