Reputation: 3175
This is linked to a question I asked yesterday. Briefly, the problem I'm having is that I have two conflicting versions of an assembly. One is in the appbase and the other is in the PrivateBinPath.
From what I understand the assembly resolver searches the appbase first and then searches in the private path. The problem is that, based on what I got by running fusion log, if the resolver finds the wrong version in the appbase it throws an error saying the version doesn't match and stops probing.
I need to use references located in the appbase, so setting the PrivateBinPathProbe is not an option because it excludes the appbase. Is there any way to change the order to search in the PrivateBinPath first?
As a side note, I do not understand why the resolver just gives up if it finds the wrong version.
Upvotes: 3
Views: 1794
Reputation: 7895
The AssemblyResolve
event is only called when the previous lookup was not successfull. So you have to combine the approach from Yahia with the answer from your previous question:
PrivateBinPathProbe
so that Fusion will not look in the AppBase directory.AssemblyResolve
event that resolves the path to your AppBase directory.The first step is important so that the event gets fired.
Upvotes: 2
Reputation: 70369
There is AFAIK no option to do that...
You could however implement a workaround:
AssemblyResolve
handlerAnother option is to embed the dependencies into the EXE/DLL so there is no need to search any path at all - for options to achieve this see here.
Upvotes: 1