Mixed mode dlls

Asked by Marco Meinhardt

Are there any known problems for executing tests in the following setup:

Unit test in managed library (C#)
 -> references mixed moded library (/clr option)
   -> references native C++ library
?

This works in general for me but now and then I am running into AccessViolationException errors. If I take the unit test's code and copy it into a separate application I never get that exception.

I found a post with a similar question here: https://bugs.launchpad.net/nunitv2/+bug/558522

What confuses me is the answer from Charlie Poole:
"You have to change your property setting for CLR support to /clr:pure

NUnit has never worked with mixed (CIL + code) assemblies."

Is that actually (still) so?

Sorry, if this question already has been answered elsewhere but I could not find it.

Question information

Language:
English Edit question
Status:
Answered
For:
NUnit V2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Charlie Poole (charlie.poole) said :
#1

Reviewing the post you reference, I see that my answer was out of context.

NUnit requires that any C++ test assemblies it loads be pure code. Various
combinations of references _from_ that pure code should be able to work.

In particular, native code referenced by your tests works quite well
and - although
I have no experience with it - mixed mode references should work equally well.

It seems to me that you really need input from a variety of folks with
experience
using mixed mode assemblies - you won't get that here, since I'm pretty much
the only one who posts answers. I suggest re-posting on the nunit discussion
list (nunit-discuss on google groups).

Charlie

On Mon, Jul 4, 2011 at 7:11 AM, Marco Meinhardt
<email address hidden> wrote:
> New question #163715 on NUnit V2:
> https://answers.launchpad.net/nunitv2/+question/163715
>
> Are there any known problems for executing tests in the following setup:
>
> Unit test in managed library (C#)
>  -> references mixed moded library (/clr option)
>   -> references native C++ library
> ?
>
> This works in general for me but now and then I am running into AccessViolationException errors. If I take the unit test's code and copy it into a separate application I never get that exception.
>
> I found a post with a similar question here: https://bugs.launchpad.net/nunitv2/+bug/558522
>
> What confuses me is the answer from Charlie Poole:
> "You have to change your property setting for CLR support to /clr:pure
>
> NUnit has never worked with mixed (CIL + code) assemblies."
>
> Is that actually (still) so?
>
> Sorry, if this question already has been answered elsewhere but I could not find it.
>
>
>
>
> --
> You received this question notification because you are an answer
> contact for NUnit V2.
>

Revision history for this message
Marco Meinhardt (meinhardt) said :
#2

Ok, I'll try try that.

Thanks!

Can you help with this problem?

Provide an answer of your own, or ask Marco Meinhardt for more information if necessary.

To post a message you must log in.