Re: Search path for assemblies

From: Richard Blewett [DevelopMentor] (richardb_at_NOSPAMdevelop.com)
Date: 11/29/04


To: microsoft.public.dotnet.framework
Date: Mon, 29 Nov 2004 07:18:30 -0800

You can only extend the probing path to subdirectories under the appbase, sibling directories will not be searched via probing.

 The whole point of this is that without strong names there is no way for the runtime to guarantee that its picked up the correct assembly as it only performs file name matching. So you could accidently pick up an assembly that someone else wrote that just happened to have the same name as the one you intended. Thats why for non-strong named assemblies the assembly resolver works on the basis that the child assemblies are physically constrined within the Appbase and its subdirectories

 Regards

 Richard Blewett - DevelopMentor
 http://www.dotnetconsult.co.uk/weblog
 http://www.dotnetconsult.co.uk

   Hi,
 
 yes, you can add a probing element to your app.config file: -
 
 <configuration>
 <runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
 <probing privatePath="bin1;bin2\bin3;..\MyPrivatePath"/>
 </assemblyBinding>
 </runtime>
 </configuration>
 
 Here, it will search for the referenced assemblies in the path bin1,
 bin2\bin3 relative to your assembly's path, and MyPrivatePath as root
 relative to your assembly's path.
 
 Let me know if you need anything else.
 
 Thanks
 Joyjit



Relevant Pages

  • Re: Hi
    ... Regards ... Richard Blewett - DevelopMentor ... Checked by AVG anti-virus system. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Combo box refresh
    ... >> Richard Blewett - DevelopMentor ... In PopulateDatasetList how is this populating the combobox? ... Regards ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: passing parameter to thread ??
    ... Diving in before Jon does;-) ... Regards ... Richard Blewett - DevelopMentor ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Strong name trouble
    ... > Richard Blewett - DevelopMentor ... >> My code DOES NOT WORK if assemblies ARE strong name. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Messagebox.Show refresh
    ... Regards ... > Richard Blewett - DevelopMentor ... > In a C# application I use a message box to display an error. ...
    (microsoft.public.dotnet.framework)