3
votes

I have a asp.net website poject. I need to use several custom dll's which I can't copy into the bin directory.

I tried to create a custom bin folder and set on Application_Start PrivateBinPath in Global.asax to that directory



    void Application_Start(object sender, EventArgs e) 
        {
            AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = Server.MapPath("~/my_DLLS");
        }

then in my .cs file use a using statement to include that dll but I'm getting Compiler Error Message: CS0246: The type or namespace name 'DLLNAME' could not be found (are you missing a using directive or an assembly reference?)

I also trying to add assemblyBinding in web.config



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

i feel like i'm missing something.

1
Try moving the entire project to an easy-to-access path, like C:\Test, no spaces or anything and try again. - Hanlet EscaƱo
the project is on the server. the path contains no spaces. I'm able to reference all the dll from the bin directory but not from my custom directory - VGV

1 Answers

0
votes

Some thoughts

  1. Make sure that your private bin path is under the application root (your code indicates that it is - but just confirm)

  2. Do the private bin dlls have any dependencies that are not present in the private bin

  3. You can use fusion log viewer to check the bindings of the dlls in your app. That should indicate if there are bound or not

  4. Check permissions on the private bin folder. Hit it with a hammer and give everyone full permissions on that folder. See if that brings it up

  5. As a temporary measure - put the private bin folder as a sub directory under your bin folder. Does that work now? Could that be a permanent solution if it does work. Might not be a goer for you

This is a good answer about a similar problem - with a nice diagram that you might find helpful

How do I reference assemblies outside the bin folder in an ASP.net application?

And of course good luck