OpenRasta 支持 Mono 吗?

发布于 2024-08-26 06:15:20 字数 365 浏览 10 评论 0原文

虽然 Mono 支持对我们来说并不是什么大问题,但我认为 OpenRasta 支持它,因为它有一些关于它的提交消息..

好吧,我尝试在 Mono 上构建它并得到了不明确的类型引用(在手动创建 10 个 obj 之后) 目录。)因此,我尝试仅使用手头的预构建程序集,这给了我一个 Object Reference Not Set To Instance of an Object (这是我在使用 mono.. 时遇到的常见错误) )在OpenRasta.Diagnostics.DebuggerLoggingTraceListener.WriteAll(使用xsp2)

是否有对Mono的官方支持,或者我是否缺少一些额外的部署步骤?

Although Mono support is not a big deal for us, I figured OpenRasta supported it cause it has some commit messages about it..

Well, I tried to build it on Mono and got Ambiguous type references(after manually creating like 10 obj directories.) So I tried just using the prebuilt assemblies I had on hand and that gave me an Object Reference Not Set To Instance of an Object (the usual error I have with mono.. ) at OpenRasta.Diagnostics.DebuggerLoggingTraceListener.WriteAll (using xsp2)

Is there official support for Mono or am I missing some sorta extra step for deployment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

暗喜 2024-09-02 06:15:20

我设法获得了一个简单的 OpenRasta 示例,以 XML/JSON 提供简单的表示形式,并通过 OpenBastard.Envrionments.HttpListenerHostWithConfiguration 托管,在 Mono (2.6.3) 上运行,对其进行了少量更改(OpenRasta 的;特别是 2.0) .3000分支)源代码。

我已经为任何感兴趣的人提供了补丁 。这些更改应该是相当不言自明的(我已经添加了注释),但我还将概述下面修改的原因...

  1. OpenRasta.Diagnostics.DebuggerLoggingTraceListener 假设它将传递对 System 实例的引用由 System.Diagnostics.TraceSource 调用时的 .Diagnostics.TraceEventCache。此假设在 .NET 框架上成立,但 TraceSource 的 Mono 实现始终传递空引用。

  2. 对于 OpenRasta.Hosting.AmbientContext 和 OpenRasta.Hosting.ContextScope 中引用的 System.Runtime.Remoting.Messaging.CallContext.HostContext 属性的 get 和 set 方法,Mono 都会引发 NotImplementedException。

  3. 当与先前请求相对应的 System.Net.HttpListenerResponse 对象或其基础流尚未显式关闭时,来自客户端的后续请求可能会失败。这一点我不太清楚,MSDN 文档规定必须关闭响应对象,但我遇到的问题在 .NET 框架上运行时并没有出现。

我目前正在从事一个业余爱好项目,该项目需要在 Mono 上设计和构建 RESTful Web 服务,我将在需要时更新补丁;希望有人会发现它有用。

免责声明:我对 OpenRasta 非常陌生,对 C#/“严肃”软件开发也相对较新。除了上面提到的组件之外,我还没有测试过 OpenRasta 的任何其他组件,并且单元测试仍然严重失败;您的里程可能会有所不同。

I've managed to get a simple OpenRasta example, serving a trivial representation in XML/JSON and hosted via OpenBastard.Envrionments.HttpListenerHostWithConfiguration, running on Mono (2.6.3) with a small set of changes to its (OpenRasta's; specifically the 2.0.3000 branch) source code.

I've made my patch available here for anyone that's interested. The changes should be fairly self explanatory (I've included comments) but I'll also outline the reasons for the modifications below...

  1. OpenRasta.Diagnostics.DebuggerLoggingTraceListener assumes that it will be passed a reference to an instance of System.Diagnostics.TraceEventCache when invoked by System.Diagnostics.TraceSource. This assumption holds on the .NET framework but Mono's implementation of TraceSource always passes a null reference.

  2. Mono throws a NotImplementedException for both the get and set methods of the System.Runtime.Remoting.Messaging.CallContext.HostContext property referenced in OpenRasta.Hosting.AmbientContext and OpenRasta.Hosting.ContextScope.

  3. Subsequent requests from a client can fail when the System.Net.HttpListenerResponse object, or its underlying stream, corresponding to the previous request has not been explicitly closed. This point I am less clear on, the MSDN documentation states that the response object must be closed but the issue I encountered did not present itself when run on the .NET framework.

I'm currently working on a hobby project that entails designing and building a RESTful web service on Mono, I'll update the patch as and when I need to; hopefully someone will find it useful.

Disclaimer: I'm very new to OpenRasta and relatively new to C# / "serious" software development in general. I've not tested any other components of OpenRasta outside those mentioned above and the unit tests continue to fail hard; your mileage will probably vary.

非要怀念 2024-09-02 06:15:20

OpenRasta 目前尚未在单声道上进行测试。这将随着下一次迭代而改变,但答案是“我不知道”。

DebuggerLoggingTraceListener 正在写入调试器输出,mono 可能对代码的工作方式有不同的期望。

OpenRasta is not being tested on mono at the moment. This is changing with the next iteration, but the answer is "i don't know".

DebuggerLoggingTraceListener is writing to the debugger output, mono may have different expectations of how the code works.

睫毛上残留的泪 2024-09-02 06:15:20

如果您想要一个也可以在 MONO 上运行的 Web 服务框架,您应该查看 http://www.servicestack.net

它还可以托管在控制台应用程序(独立于 Web 服务器)或任何 ASP.NET 应用程序中,包括:

  • IIS 6.0/7.0
  • Apache + Mod_Mono XSP
  • 支持 FastCGI 的 Web 服务器,如 Nginx、Cherokee 等

If you want a web service framework that also runs on MONO you should check out http://www.servicestack.net

It can also be hosted in a Console Application (independent of a Web Server) or any ASP.NET application including:

  • IIS 6.0/7.0
  • Apache + Mod_Mono XSP
  • FastCGI enabled web servers like Nginx, Cherokee, etc
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文