Showing posts with label Assembly. Show all posts
Showing posts with label Assembly. Show all posts

Wednesday, May 20, 2009

Resgining a 3rd Party Assembly

Many a times we've to ship 3rd party source code alongwith our code. The catch comes when the 3rd party assembly is an unsigned assembly while you have a strong need to sign the assembly being shipped by you.
If you try to refer an unsigned assembly into an assembly which is being signed then you get an error which says "Assembly generation failed Referenced assembly ‘xxx’ does not have a strong name"

The easy solution to this problem is to resign the 3rd party assembly using your key.
You can fing out how to do it on the blog by allkampfer on this link.

Happy signing :)

~Abhishek

Thursday, May 14, 2009

Using Fusion Logs to debug the assembly binding failures

While working with WCF i wrote a custom Client Message level interceptor and as usual WCF tries to load the assembly containing the interceptor type using reflection.
While doing this WCF runtime threw an exception which suggested that the Assembly Binding failed however no information is supplied regarding why the binding is failing except that it failed with HRESULT 0x80131040
In order to find the exact reason we can enable the fusion logs and check the actual binding steps going on in order to find the actual problem in binding
To do this following steps should be used to check the binding process
1) Make a DWORD entry to the Registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FusionEnableLog and change its value to 1
2) Open the fusion log viewer fuslogvw from the command prompt
3) In the settings of log viewer select the option to log the binding failures to disk
4) Restart the process which is having binding failures
5) Refresh the log viewer and you'd see the exact reasons why the bindings are failing

Happy coding :)

~Abhishek