Where should I do this? The exception for the load failure already
occurs before my first line of code is executed, so how can I handle
this event?

Peter

On Apr 29, 6:16 am, Savani Mahesh <[email protected]> wrote:
> Hi,
>
> Use AssemblyResolve event of Application Domain. This event is raised when
> CLR founds a reference to an assembly, tries to find that assembly and fails
> to get that assembly. In this event, you can load that assembly yourself and
> give it to CLR.
>
> You can use event in this way (C#).
> AppDomain.CurrentDomain.AssemblyResolve
>
> Regards,
> Mahesh Savani
>
> On Tue, Apr 28, 2009 at 2:15 PM, Peter Laman <[email protected]> wrote:
>
> > I created a Windows service with C#, which is to be part of a larger
> > product. It uses a few assemblies created by a different team, that
> > are located within the folder structure of the the product. The
> > installer for the product sets up a folder structure with fixed
> > relative paths, so I want to specify the location of the referenced
> > assemblies using a relative path (like "..\..\lib\sdk.dll").
>
> > Can anybody tell me how to do that? I don't want to add code to load
> > the assemblies at runtime, for development I just want to specify them
> > under the 'references' in my VS solution. The only thing I want to
> > tell the CLR is explicitly where to look for the assembly and I want
> > to do JUST THAT at runtime.
>
> > Thanks for any help.
>
> > Peter

Reply via email to