How to load referenced assemblies from any place you want
This is HowTo for those who need it. The app.config file below defines rules for the main assembly. It sets where the referenced assemblies could be found at runtime. The main assembly references other two assemblies and gets one of them from network (\\someserver\shared\Summator.dll) and another one from the local machine in a subdirectory.
Application config file is below:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="Summator"
publicKeyToken="03840bb05afb3f17"
culture="neutral" />
<codeBase
version="1.0.0.0"
href="file:///\\someserver\shared\Summator.dll"/>
</dependentAssembly>
<probing privatePath="SUB1\SUB2\SUB3\">
</probing>
</assemblyBinding>
</runtime>
</configuration>
If you reference an assembly from your local machine, you are not limited by subdirectories of the main application because you can use the following method to mount your drives to one of the subdirectories:
http://support.microsoft.com/kb/307889
PS: Configuration files can be conveniently edited by the mscorcfg.msc tool (Control Panel – Administrative Tools – Microsoft .NET Framework 2.0 Configuration, MyComputer, Application, Right click, Add…).
No comments yet.
Leave a comment
-
Recent
- Remote desktop via VPN from SUSE 11.1
- EVPO DC project structure
- EVPODC Getting Started Part 2 (Configuration)
- EVPODC getting started part 1 (installation)
- Customize property editor in the VS designer
- How to load referenced assemblies from any place you want
- The puzzle about a car and two goats
- Effect of XML:Space=”preserve”
- regular expressions for XML tags
-
Links
-
Archives
- May 2009 (2)
- November 2008 (2)
- June 2008 (5)
-
Categories
-
RSS
Entries RSS
Comments RSS