Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does OpenRasta support Mono?

Tags:

mono

openrasta

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?

like image 721
Earlz Avatar asked Mar 26 '10 03:03

Earlz


People also ask

What version of .NET does Mono support?

NET Framework 4.7. 2 and Mono 6.6.

Can Mono run .NET framework?

, LBNL, Berkeley, CA 94720, U.S.A. Mono is an independent implementation of the . NET Framework by Novell that runs on multiple operating systems (including Windows, Linux and Macintosh) and allows any . NET compatible application to run unmodified.

Does .NET 6 use Mono?

Visual Studio 2022 for Mac has parted ways with the Mono runtime in the just-published Preview 5, now running on . NET 6. The dumping of Mono comes as the dev team works to adopt a fully native macOS UI and run the IDE natively on Apple's ARM-based M1 processor, the latter of which is key to adopting .

Is .NET core based on Mono?

NET Core is different from Mono in the same sense as . NET Framework and . NET Core. Core does not support any of the backwards compatibility that Mono has like .


2 Answers

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.

like image 85
jkirk Avatar answered Oct 13 '22 18:10

jkirk


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.

like image 34
SerialSeb Avatar answered Oct 13 '22 18:10

SerialSeb