manage assembly binding redirections

Jan 4, 2008 at 11:33 AM
Hi
I need to embed an assembly into the GAC foder. But this assembly reference another old assembly, and I've made a config file to enable binding redirection to another newer version of the second assembly.

Unfortunately, WSPBuilder use Assembly.ReflectionOnlyLoad(), to load assembly to add in GAC, wich not use the binding configuration.

I've tried to change by putting Assembly.Load() instead, but it has side effect on path config loading, making a stack overflow exception at Config.cs in method "GetArgumentDirectory" ... :(

It will be usefull if assemblies could be loaded by using the binding config files...

(I previously use the Visual studio 2005 WSS tools to generate solution for WSS, but it is very unstable for deploying, and it make a very long time, WSPBuilder save me a lot of time ! Great great Work ! )
Coordinator
Feb 6, 2008 at 6:43 PM
To fix this problem with reference dll's, I plan to use the Mono.Cecil library for reading assemblies. This enables me to get the information I need without having to resolve every assembly referenced in the main assembly. However using Mono.Cecil is a major change so it will be some time before I implement it.

/keutmann


lio2332 wrote:
Hi
I need to embed an assembly into the GAC foder. But this assembly reference another old assembly, and I've made a config file to enable binding redirection to another newer version of the second assembly.

Unfortunately, WSPBuilder use Assembly.ReflectionOnlyLoad(), to load assembly to add in GAC, wich not use the binding configuration.

I've tried to change by putting Assembly.Load() instead, but it has side effect on path config loading, making a stack overflow exception at Config.cs in method "GetArgumentDirectory" ... :(

It will be usefull if assemblies could be loaded by using the binding config files...

(I previously use the Visual studio 2005 WSS tools to generate solution for WSS, but it is very unstable for deploying, and it make a very long time, WSPBuilder save me a lot of time ! Great great Work ! )