tags:

views:

260

answers:

2

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?

+2  A: 

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.

serialseb
+4  A: 

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.

jkirk