tags:

views:

207

answers:

2

One of our partners provided us with an assembly we need to access from our application. Unfortunately, this is not strong-name so we can't install it to the GAC. And we can't place it in the same place as our executable.

Is there a solution for this?

EDIT: This will be a temporary solution only for testing, when they go RC, we will have a strong-named assembly.

+3  A: 

You have a few options at that point.

The first is to place the assembly in a directory that has the name of the assembly (without the extension) which is a subdirectory of the application directory.

The second is to specify the sub directory you want the CLR to probe for references in the app.config file using the probing element.

Finally, you can load the assembly dynamically using the various Load methods on the Assembly class but I would say that's a very bad idea in this case, given that you have the assembly, and you have concrete types that you want to use in it. Late time assembly loading like this is typically used when you want to subsitute the implementation of certain abstractions, which doesn't seem to be the case here.

casperOne
+1  A: 

Yet another solution is to add the following to the machine.config file:

<runtime>
  <developmentMode developerInstallation="true"/>  
</runtime>

And add DEVPATH = path to the system environment variables.

Anzurio