Hi Gadget,
Understood about the threads. I'll switch to single threads from now on with
my development problems :-) It's just that I've spent days trying to
understand where this c*** comes from. I'm a little worked up here.
so, you're saying my assembly DLL that's in another folder depends on other
assemblies which are not to be found in the folder it resides at? I think
that's the case here. it DOES reference some other assemblies that just
happen to reside in the app folder, which might explain the reason it works
fine when it's copied there.
What's the best practice of resolving this? is there somehting like a
generic "search path" I can set during runtime? (e.g. registering the DLLs
my assembly depends on in the GAC?)
Thanks,
Ron
>> My question is: why do I need to have a copy of the myassembly.dll reside
>> at
[quoted text clipped - 18 lines]
> Cheers,
> Gadget
Gadget - 25 Nov 2006 05:55 GMT
> Hi Gadget,
>
[quoted text clipped - 37 lines]
>> Cheers,
>> Gadget
I'm not sure what your easiest solution is. One method that springs to mind
is that your DLL will raise an AppDomain.AssemblyResolve event whenever it
wants an external DLL, so you could always intercept this event and have it
source those DLLs from the application's folder.
There may be an easier way, but other than sticking your shared DLLs in the
GAC I'm not sure what that might be.
Cheers,
Gadget
Chris Dunaway - 27 Nov 2006 13:59 GMT
> What's the best practice of resolving this? is there somehting like a
> generic "search path" I can set during runtime? (e.g. registering the DLLs
> my assembly depends on in the GAC?)
If you want to organize your app folder and place your .dll's in a
separate folder, you can use a couple of methods. The first is the
AppDomainSetup.PrivateBinPath Property. You can use this to set which
folders under the app folder for the program to probe for your
assemblies. I have not used this method. I have used the
AppDomain.AppendPrivatePath method which I see is now marked as
obsolete.
You can also add an entry to the app.config file which specifies where
the app should look for assemblies:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin2\subbin;bin3"/>
</assemblyBinding>
</runtime>
</configuration>
All of these methods only probe folder that are below the main app
folder.
Hope this helps
Chris