OpenRasta 支持 Mono 吗?
虽然 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我设法获得了一个简单的 OpenRasta 示例,以 XML/JSON 提供简单的表示形式,并通过 OpenBastard.Envrionments.HttpListenerHostWithConfiguration 托管,在 Mono (2.6.3) 上运行,对其进行了少量更改(OpenRasta 的;特别是 2.0) .3000分支)源代码。
我已经为任何感兴趣的人提供了补丁 。这些更改应该是相当不言自明的(我已经添加了注释),但我还将概述下面修改的原因...
OpenRasta.Diagnostics.DebuggerLoggingTraceListener 假设它将传递对 System 实例的引用由 System.Diagnostics.TraceSource 调用时的 .Diagnostics.TraceEventCache。此假设在 .NET 框架上成立,但 TraceSource 的 Mono 实现始终传递空引用。
对于 OpenRasta.Hosting.AmbientContext 和 OpenRasta.Hosting.ContextScope 中引用的 System.Runtime.Remoting.Messaging.CallContext.HostContext 属性的 get 和 set 方法,Mono 都会引发 NotImplementedException。
当与先前请求相对应的 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...
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.
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.
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.
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.
如果您想要一个也可以在 MONO 上运行的 Web 服务框架,您应该查看 http://www.servicestack.net
它还可以托管在控制台应用程序(独立于 Web 服务器)或任何 ASP.NET 应用程序中,包括:
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: