
moq - issue #87
BadImageFormatException when using a mock with a Visual Studio generated Accessor object
(see attached solution for repro) The exception is thrown when running tests but not when debugging them.
Submitting so that I could attach the solution; this is a bug in either Castle or VS, not in Moq (as far as I can tell).
- WTHDebugDoesntThrow.zip 340.8KB
Comment #1
Posted on Feb 4, 2009 by Happy RabbitWow... was just looking at this issue and it's WEIRD! I'm thinking whether this might be an x64 issue? I run the same example but selecting an explicit x86 target platform, to force the 32bit CLR, but got the same error. I'm wondering if it might work if you compile the Unity assemblies for x86 explicitly?
Comment #2
Posted on Mar 16, 2009 by Happy LionI don't think it is a x64 issue, I get the same error on a x86 XP machine and a x64 Vista Enterprise machine
Ryan Rauh
Comment #3
Posted on Jul 4, 2009 by Helpful OxCan you redo the test project to not use MSTest? I could take a look at it then.
Comment #4
Posted on Oct 1, 2009 by Quick LionIs this issue still occurring under the latest builds of DynamicProxy?
Comment #5
Posted on Apr 7, 2010 by Happy CamelI'm afraid yes - this issue occurs with latest moq for silverlight when trying to mock IUnityContainer
Comment #6
Posted on Apr 7, 2010 by Helpful Oxwhich version of DP does latest Moq use?
Comment #7
Posted on Apr 7, 2010 by Helpful OxI just checked on the trunk version of DP (without MOQ) and it works like a charm. Pretty sure it works on v2.2 as well.
Comment #8
Posted on Apr 12, 2010 by Helpful HorseIs the real problem here the "where" clauses on the IUnityContainer methods? See also issue #245.
Comment #9
Posted on Apr 12, 2010 by Helpful OxYes, the where clause was the issue, and it is fixed (supported) now in DP 2.2
Comment #10
Posted on Apr 12, 2010 by Happy RabbitUpdate to DP2.2
Comment #11
Posted on Apr 21, 2010 by Happy LionTrunk version
Status: Fixed
Labels:
Type-Other
Priority-High
Milestone-Release4.0