我正在运行 Ubuntu 12.04,并且安装了单运行时包。在我的 Windows 机器上,我的 NancyFx 自托管应用程序编译正常,但有 1 个警告,但是当我尝试在我的 VPS 上运行它时,出现以下错误:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one
of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load
file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
关于如何解决这个问题有什么想法吗?
最佳答案
尝试在 Ubuntu 14.04 Docker 虚拟机上运行 Mono 应用程序(在我的 Windows 机器上的 Xamarin Studio 中编译)时,我遇到了同样的问题。我和你做了同样的事情并安装了 mono-runtime
,经过一两个小时的搜索,在安装 mono-complete
后能够让它工作。但是,这也减少了几百 MB 的额外内容。最后我找到了解决问题的包:libmono-system-core4.0-cil
( see here )。
希望对您有所帮助!
关于c# - 运行 NancyFx 时单声道中未处理的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24814275/