gpt4 book ai didi

c# - 带有 Mono 4.2.3 的 Web Api 2

转载 作者:太空宇宙 更新时间:2023-11-04 12:52:32 24 4
gpt4 key购买 nike

<分区>

我有一个在 VS2015 中构建并在 Windows 上编译的 Web API 站点。该站点使用了一些库,目标平台是 4.5.2。

我将编译后的程序集放在一个 ubuntu linux trusty box 上,该 box 具有来自 mono-complete deb 的 mono 4.2.3 运行时。

站点本身使用 OWIN 自托管模式运行,我有一个服务器项目,其中包含一个启动类和一个单独的 exe 项目,用于加载和运行它。然后我尝试在 ubuntu 机器上运行我的项目,我得到以下输出:

Unknown errno: Protocol error
Unknown errno: Protocol error
Unknown errno: Protocol error
Unknown errno: Protocol error

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Net.Http.Formatting.MediaTypeConstants' threw an exception. ---> System.InvalidProgramException: Invalid IL code in System.Net.Http.Headers.MediaTypeHeaderValue:.ctor (string): method body is empty.

服务的bin目录包含System.Net.Http和System.Net.Http.Formatting dll。我可以看到 mono 本身有这些 dll 的 GAC 版本,所以我将它们从 bin 中删除,希望该项目将恢复使用 mono 自己的 GAC,但随后我收到加载程序错误,因为我的项目似乎正在寻找其中的 5.2.3.0 dll 不是 4.0.0.0。我检查了 vs2015,我可以看到这些引用似乎是 4.0.0.0,所以我有点困惑。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com