PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : .NET Assemly search path


stittx
2004-10-01, 10:12:51
Hi all,

I want to load a .Net Assembly in my Application, which is not located in the start folder of my App.
The Assembly-DLL I want to load is not shared and not registered in the GAC of the computer.

Does anybody knows a way how to load it!

I have heard ther is a way to add a search path for the assembly in the App.config file.
But I do not know thw respectin XML syntax.

Need Help

Thanks

Thomas

D-Swat
2004-10-01, 11:21:24
Yes the app.config is one way to define private assembly loading paths.
You need to add the following to your app.config:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="path1;path2" />
</assemblyBinding>
</runtime>


The <runtime> tag is a child of the <configuration> tag. So your app.config will probably look like this.

<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="path1;path2" />
</assemblyBinding>
</runtime>
</configuration>


Maybe this Microsoft MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/html/_3__path_for_private_components.asp) Page will also help you.