Problems with NUnit under Mono

2019-07-15 10:59发布

问题:

my problem is that I have a project developed in visual Studio .NET 4.0 and it must have compatibility with Mono.

MoMa tool says that there's no problem. When I try to run the tests with NUnit Mono 2.0 Profile says to me the next exception:

System.MissingMethodException...
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000] in <filename unknown>:0 

I have Mono 2.10 installed, and if I try to run another project test debeloped with MonoDevelop with Nunit Mono 2.0 profile works, so, what can I do?

P.S.: the purpose is to run the unitary tests under Mono, to ensure that they work under it.

回答1:

Make sure you are compiling your test project as .NET Framework 2.0 if you are going to run it under the Mono 2.0 Profile. It sounds like you are references .NET 4.0 code and trying to run it under Mono's 2.0 profile.