c# - Mono 3.0/Debian/asp.net - 找不到方法 : 'System. Configuration.IConfigurationSectionHandler.Create

标签 c# asp.net asp.net-mvc linux mono

Debian Sid,单声道 3.0。我正在尝试运行 mvc 应用程序(它在将单声道升级到 3.0 之前有效)。这是抛出的异常:

Exception caught during reading the configuration file:
System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'.
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
  at Mono.WebServer.Apache.Server.get_AppSettings () [0x00000] in <filename unknown>:0 
  at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x00000] in <filename unknown>:0 

我还发现了在/usr/bin/mod-mono-server4 中进行更改的提示:

#!/bin/sh
exec /usr/bin/mono $MONO_OPTIONS "/usr/lib/mono/4.0/mod-mono-server4.exe" "$@"

收件人:

#!/bin/sh
exec /usr/bin/mono $MONO_OPTIONS "/usr/lib/mono/4.5/mod-mono-server4.exe" "$@"

不幸的是,没有这样的文件:/usr/lib/mono/4.5/mod-mono-server4.exe(/usr/lib/mono/4.5/目录中没有这样的文件)。

你知道哪里出了问题吗?我的应用程序是 ServiceStack 简单网页,它适用于 mono 2.10。但升级到 3.0 后它就不再工作了。

最佳答案

您需要为该文件添加一个符号链接(symbolic link)

# ln -s /usr/lib/mono/4.0/mod-mono-server4.exe /usr/lib/mono/4.5/mod-mono-server4.exe

这样它仍然会使用 mod-mono-server4.exe,但会使用 4.5 dll

关于c# - Mono 3.0/Debian/asp.net - 找不到方法 : 'System. Configuration.IConfigurationSectionHandler.Create,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16583114/

相关文章:

c# - WaitForElementClickable/Visible - Selenium C#

c# - 设置 ContentControl.Content 时会生成什么事件?

asp.net - JavaScript window.parent 问题

c# - 通过 '&' ,从选定的选项值返回,在 url

c# - C# asp.net性能实践中使用static automapper

asp.net-mvc - ASP.NET MVC 应用程序中的多种语言?

c# - 将 SQL Server 2012 指定为目标平台的项目可能会遇到与 Microsoft Azure SQL 数据库 v12 的兼容性问题

c# - 我如何遍历 PropertyCollection

c# - 从 Excel 文件中提取数据并存储在 SQL Server 数据库中

asp.net-mvc - 如何使用 ASP.Net Web API 防止 session 跳跃?