Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using <codebase> element in app.config

I intend to keep few dll's in a folder other than the bin folder for my .NET 3.5 Windows application. I am unsure of how would I use the codebase element or the probing element to specify the right path. This is what I have in the app.config file now,

<runtime>
 <assemblyBinding>
  <dependentAssembly>
    <assemblyIdentity name="CommonLib" publicKeyToken="f0b5026b59d5645e"   
     culture="neutral" />
    <codeBase version="1.0.0.0" href="SharedFolder\CommonLib.dll" />
  </dependentAssembly>
 </assemblyBinding>
</runtime>

I get, Could not load assembly error at runtime. It seems I am doing something wrong in the config file. The SharedFolder is a folder added to the project.

like image 707
theraneman Avatar asked Dec 14 '09 16:12

theraneman


1 Answers

It seems the codeBase element is for getting files with a URL, have you tried using the probing element?

<runtime>
 <assemblyBinding>
  <dependentAssembly>
    <assemblyIdentity name="CommonLib" publicKeyToken="f0b5026b59d5645e"   
     culture="neutral" />
  </dependentAssembly>
  <probing privatePath="SharedFolder"/>
 </assemblyBinding>
</runtime>
like image 196
Yuriy Faktorovich Avatar answered Nov 11 '22 07:11

Yuriy Faktorovich