Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
app.config :
C#
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<probing privatePath="bin2"/>
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
</configuration>


but this set does not work,the application does not search bin2 dir.
Posted

The following article shows up 3 methods to achieve this. I think one method will fit your needs.

You have to:
1. Change "MyAssembly2" to the assembly name you want to load (Property: name)
2. Set the public token in your config file (Property: publicKeyToken)
3. Set the dll version in your config file (Property: version)
4. Set the path to the dll file in your config file (Property: href)

<configuration>
   <runtime>
      <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentassembly>
            <assemblyidentity name="MyAssembly2" culture="neutral" publickeytoken="307041694a995978" />
            <codebase version="1.0.1524.23149" href="FILE://C:/Myassemblies/MyAssembly2.dll" />
         </dependentassembly>
      </assemblybinding>
   </runtime>
</configuration>


Microsoft Article - Method 2



You can also use the AssemblyResolve event of the current app domain.
 
Share this answer
 
v2
Thank you!I will try these 3 method.
Thank you very much!
But, what do this set " <probing privatepath="bin2"> "?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900