3

Is it possible within the web.config to set the local file path location of specific DLLs to load rather than having those DLL in the GAC or C:\Windows\System32.

This would make it much easier to deploy the web service, without having to mess around with either of those.

I have tried already to add the DLLs to the project but with out success. They are the 4 oracle instant client DLLs.

  • oci.dll
  • orannzsbb11.dll
  • oraocci11.dll
  • oraociicus11.dll

If anyone knows of a way of doing this that would be great.

EDIT: Please note, note of the DLLs are "strongly named" so I cannot reference them using their public key.

Also, they are not referenced directly in the project currently because they fail to add.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
tgandrews
  • 12,349
  • 15
  • 43
  • 55
  • 1
    Any reason they can't be placed in the `bin` directory of the web service? – Oded Aug 12 '11 at 13:03
  • @Oded - Placing them in the bin doesn't seem to work. It's all to do with the path that ASP.NET uses as they aren't referenced directly. – tgandrews Aug 12 '11 at 14:55

2 Answers2

1

You can use the dependentAssembly element to specify where a dll lives through the codeBase element.

However, I believe this needs to be a valid URL.

Example from MSDN:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="myAssembly"
                              publicKeyToken="32ab4ba45e0a69a1"
                              culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0"
                             newVersion="2.0.0.0"/>
            <codeBase version="2.0.0.0"
                      href="http://www.litwareinc.com/myAssembly.dll"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>
Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • Would this work using a local file path? Or do I need to use something else? – tgandrews Aug 12 '11 at 13:22
  • @tgandrews - It needs to be a valid URL. Might be able to use a local one (possibly with the `file:///` protocol). – Oded Aug 12 '11 at 14:02
1

Probing paths let you specify where an application should look for assemblies. This won't affect putting things in the GAC, but gives you an alternative to storing everything in the bin folder.

http://msdn.microsoft.com/en-us/library/823z9h8w.aspx

Simon Halsey
  • 5,459
  • 1
  • 21
  • 32