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

Method not found: 'Void Castle.DynamicProxy.ProxyGenerationOptions.AddDelegateTypeMixin(System.Type)'.. #935

Closed
gremlm opened this issue Oct 7, 2019 · 2 comments

Comments

@gremlm
Copy link

gremlm commented Oct 7, 2019

System.MissingMethodException: Method not found: 'Void Castle.DynamicProxy.ProxyGenerationOptions.AddDelegateTypeMixin(System.Type)'.. Stacktrace at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments) at Moq.Mock`1.InitializeInstance() at Moq.Mock`1.OnGetObject() at Moq.Mock.get_Object() at Moq.Mock`1.get_Object() at Msei.Fsd.OpcUaFoundationDriver.TestDoubles.OpcSessionTestDouble.get_Object()

We are using:
Moq v.4.13.0,
Castle Core 4.4.0

What is interesting: it works in Visual Studio but fails in vstest.console.exe from command line

@stakx
Copy link
Contributor

stakx commented Oct 7, 2019

This is almost certainly a problem with your project setup / NuGet tooling. Make sure the right version of Castle.Core gets loaded. I'm going to close this since with 99.9% certainty, the problem doesn't reside with Moq, but with your own project. If you think that's in error, please post a repro project.

@stakx stakx closed this as completed Oct 7, 2019
@gremlm
Copy link
Author

gremlm commented Oct 7, 2019

Thank you for quick response.
You are right.
I just have found the issue: There were two test projects in solution. First one referencing older moq and, as result, older version of Castle.Core.DLL.
vstest.console.exe was executed for both projects. It looks like moq and Castle.Core.DLL have been loaded once. I have changed order of the projects referencing under vstest.console.exe and it started work. Microsoft vstest.console.exe does not check required versions of DLLs!

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

No branches or pull requests

2 participants