RhinoMocks breaking the compiler in recent versions of Mono / MonoDevelop?

Seeing the same thing with mono 2.10.1 and monotouch 4.0 on the simulator. But only when Linker options are set to link all assemblies.

Up vote 3 down vote favorite 1 share g+ share fb share tw.

I'm not sure exactly what broke this as I've been sporadic with my Mono/Monotouch development, but I believe it's the latest update to the mono framework. All of a sudden building my Unit Test project (which itself is a MonoTouch Library project) now breaks the compiler and it seems to be the RhinoMocks DLL (removing the reference fixes it). It looks like the RM DLL is referencing the wrong System DLL (not the MT one) but what is confusing is why this never broke before and my tests used to run fine.

I've put a simple sample SLN up on Github that reproduces the error: github.com/briandonahue/MonoIssue And here is the build ouput: Building: Sample (Debug|iPhoneSimulator) Building Solution Sample Building: Test (Debug|iPhoneSimulator) Performing main compilation... /Developer/MonoTouch/usr/bin/smcs /noconfig "/out:/Users/brian/development/Sample/Test/bin/iPhoneSimulator/Debug/Test. Dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System. Dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.

Dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core. Dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch. Dll" "/r:/Users/brian/development/Sample/lib/Rhino.Mocks.

Dll" /nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8 "/define:DEBUG" /t:library "/Users/brian/development/Sample/Test/Test. Cs" The class System.Diagnostics. EventLog could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The class System.Diagnostics.

TraceSource could not be loaded, used in System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Unhandled Exception: System.Reflection. ReflectionTypeLoadException: The classes in the module cannot be loaded. At (wrapper managed-to-native) System.Reflection.

Assembly:GetTypes (bool) at System.Reflection.Assembly. GetTypes () 0x00000 in :0 at Mono.CSharp.RootNamespace. ComputeNamespaces (System.Reflection.

Assembly assembly, System. Type extensionType) 0x00000 in :0 at Mono.CSharp.RootNamespace. ComputeNamespace (Mono.CSharp.

CompilerContext ctx, System. Type extensionType) 0x00000 in :0 at Mono.CSharp. GlobalRootNamespace.

ComputeNamespaces (Mono.CSharp. CompilerContext ctx) 0x00000 in :0 at Mono.CSharp.Driver. LoadReferences () 0x00000 in :0 at Mono.CSharp.Driver.

Compile () 0x00000 in :0 at Mono.CSharp.Driver. Main (System. String args) 0x00000 in :0 Unhandled Exception: System.Reflection.

ReflectionTypeLoadException: The classes in the module cannot be loaded. At (wrapper managed-to-native) System.Reflection. Assembly:GetTypes (bool) at System.Reflection.Assembly.

GetTypes () 0x00000 in :0 at Mono.CSharp.RootNamespace. ComputeNamespaces (System.Reflection. Assembly assembly, System.

Type extensionType) 0x00000 in :0 at Mono.CSharp.RootNamespace. ComputeNamespace (Mono.CSharp. CompilerContext ctx, System.

Type extensionType) 0x00000 in :0 at Mono.CSharp. GlobalRootNamespace. ComputeNamespaces (Mono.CSharp.

CompilerContext ctx) 0x00000 in :0 at Mono.CSharp.Driver. LoadReferences () 0x00000 in :0 at Mono.CSharp.Driver. Compile () 0x00000 in :0 at Mono.CSharp.Driver.

Main (System. String args) 0x00000 in :0 Build complete -- 1 error, 0 warnings ---------------------- Done ---------------------- Build: 1 error, 0 warnings mono monotouch monodevelop link|improve this question asked Apr 9 '11 at 18:54Brian Donahue38749 60% accept rate.

Try upgrading to Mono 2.10 and MonoTouch 4.0 – miguel.de. Icaza Apr 10 '11 at 15:21 I was afraid that might be the answer. Was hoping to hold off buying another MT license until I get closer to releasing something as opposed to just hacking in my free time :-/ – Brian Donahue Apr 11 '11 at 15:01.

Seeing the same thing with mono 2.10.1 and monotouch 4.0 on the simulator. But only when Linker options are set to link all assemblies. Works fine with Linker options set to don't link or Link SDK assemblies only.

– Brian Donahue Apr 12 '11 at 20:26 Not sure, was told to set it to link all before uploading app on pieceable.com/viewer Then got the same ReflectionTypeloadException – biorbnA Apr 13 '11 at 23:51 Yep, that worked for me: not linking AT ALL when debugging on the simulator. Linking while debugging on a device is working fine, and I'm even using a wrapped native library that I setup with the btouch command. – NovaJoe May 4 '11 at 15:10.

It was mentioned that the compiler has been enhanced in latest Mono release, so I guess now the compiler can tell you "well, I just find out I should report this as an error". :).

Same problem here. You do have to Link SDK assemblies in order to run it on the device. So, if this issue is not resolved, your app won't work.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions