Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test method throw exeption Castle.DynamicProxy.ProxyGenerationException #941

Closed
Shifty15 opened this issue Oct 17, 2019 · 1 comment
Closed

Comments

@Shifty15
Copy link

Hi,
I'm using Moq, recently we start using "in" as modificator for parameters in methods and our test failed on this exception.
I did small project where I reproduce it (ConsoleApp3.zip). Problem seems to be when I'm trying get moq.Object.

We are using:
MS Test
.NET Framework 4.7.2
Moq 4.13.0
Castle.Core 4.4.0

Stack trace:
Castle.DynamicProxy.ProxyGenerationException: There was an error in static constructor on type Castle.Proxies.TestInterface1Proxy. This is likely a bug in DynamicProxy. Please report it. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Castle.Proxies.TestInterface1Proxy' threw an exception. ---> System.MissingMethodException: Method not found: 'Int32 ConsoleApp3.TestInterface`1.GetValueWithIn(Int32 ByRef, Boolean)'.

ConsoleApp3.zip

@stakx
Copy link
Contributor

stakx commented Oct 17, 2019

Hi @Shifty15, as you can see in the exception message, this is an error thrown by DynamicProxy (which Moq uses). Your issue is a duplicate of castleproject/Core#430. I'll close this issue as the bug has to be fixed somewhere else (in the .NET / .NET Core runtimes)... nothing we can do about this in Moq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants