-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
System.Threading.Tasks.Dataflow FileLoadException #855
Comments
Ps: maybe not entirely clear from my initial issue description, but we have a hard dependency on Dataflow 4.9.0. I know this issue is resolved by using Dataflow 4.8.0, but that's not an option for us. |
Can you please post a minimal, complete and verifiable code example that reproduces this problem? Without that, we can only guess. P.S.: If the problem isn't assembly binding policy / version conflict, I'd say this looks more like a problem with DynamicProxy. The stack trace is interesting, it appears as if the |
Apologies, I overlooked the link to your repository. I've posted an "answer" there in the form of a PR there. I cannot reproduce the problem you mentioned, and I am fairly confident this is (as almost always in such cases) due to .NET / NuGet tooling. I'll close this issue here, in favor of the PR at your repo. |
Hi,
I am stuck with an issue in our build which I can't seem to resolve, and I am not sure which library is causing the issue; Moq or Workstation.UaClient.
A little backgroud:
We use two libraries (among many many others) in our solution:
In essence that shouldn't be a problem, the dependency on System.Threading.Tasks.Dataflow >= 4.8.0 is satisfied. The project that uses Workstation.UaClient explicitly references System.Threading.Tasks.Dataflow 4.9.0, so nuget is not confused which version to use. It nicely downloads the 4.9.0 dependency, and everything compiles just fine.
The problem arises, when I create a new Mock and retrieve its object as follows:
I get a FileLoadException on the statement 'mock.Object'. The interface (IWhatever) which is mocked, defines a type which depends on System.Threading.Tasks.Dataflow.
The stacktrace looks as follows:
System.IO.FileLoadException : Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.6.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at Castle.DynamicProxy.Generators.MethodSignatureComparer.GetHashCode(MethodInfo obj)
at System.Linq.Set
1.InternalGetHashCode(TElement value) at System.Linq.Set
1.Find(TElement value, Boolean add)at System.Linq.Enumerable.d__64
1.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)at Castle.DynamicProxy.Generators.MethodFinder.GetAllInstanceMethods(Type type, BindingFlags flags)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectMethods(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.MembersCollector.CollectMembersToProxy(IProxyGenerationHook hook)
at Castle.DynamicProxy.Contributors.InterfaceProxyWithoutTargetContributor.d__3.MoveNext()
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.CollectElementsToProxy(IProxyGenerationHook hook, MetaType model)
at Castle.DynamicProxy.Generators.InterfaceProxyWithoutTargetGenerator.GenerateType(String typeName, Type proxyTargetType, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.<>c__DisplayClass6_0.b__0(String n, INamingScope s)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func
3 factory) at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors) at Moq.Mock
1.InitializeInstancePexProtected() in C:\projects\moq4\src\Moq\Mock.Generic.cs:line 264at Moq.Mock
1.OnGetObject() in C:\projects\moq4\src\Moq\Mock.Generic.cs:line 277 at Moq.Mock
1.get_Object() in C:\projects\moq4\src\Moq\Mock.Generic.cs:line 208at ClassLibrary2.Class1.Reproduce() in D:\Development\uaclientdataflow\ClassLibrary2\ClassLibrary2\Class1.cs:line 16
So, the Moq library throws the exception. Is it fair to say that Moq also causes this problem? And if so, can it be fixed?
I uploaded this very trivial project to github:
https:/basprins/uaclientdataflow
I hope somebody can have a look at this !
Many thanks in advance,
if I need to provide anything else, I am more than willing to share!
The text was updated successfully, but these errors were encountered: