views:

565

answers:

7

I have a 3rd party workflow software (Captaris Teamplate) that's referencing an assembly from my project that's referencing other assemblies from our project solution all through GAC. When our app executes it invokes Captaris Teamplate method to create a workflow process which in turn uses project assemblies in GAC to store data into a DB. Problem is when I compile my project and remove assemblies from GAC replacing them with new versions, but when I run entire project, Captaris Teamplate throws an error:

Exception Type: System.IO.FileNotFoundException Message: File or assembly name VBAssembly, or one of its dependencies, was not found.
FileName: VBAssembly
FusionLog: === Pre-bind state information ===
LOG: DisplayName = VBAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

That is it wouldn't give me the name of the assembly dll it's trying to find nor version it's looking for. Troubleshooting of such an issue is like shooting in the dark and it can kill days of deleting old assemblies that are kept in "Asp.net temporary files" folder, project folder and website folder (inetpub), rebooting etc, testing for error, getting an error, searching for some other old assemblies etc.

So my questions are:

  1. Is there a technique that would allow me to extract more info on this exception such as the name of the assembly and version that is missing?
  2. Is there an easy way to clean up all those old assembly versions from the system at compile time?
  3. Any other suggestions in dealing with this DLL Hell and/or Captaris Teamplate?

We're using Asp.net version 1.1 with Visual Studio 2003 with Captaris Workflow 5.0

A: 

Starting point. Try use 'Clean Solution' option and then build the solution.

J Angwenyi
+1  A: 

If at all possible avoid the GAC. It lends its self to dll hell. This VBAssembly may actually be unmanaged. And may have been removed from the windows/system32 directory.

Aaron Fischer
+1  A: 

Another thing you can do is "forcibly" reference the version of the assembly you want through the web.config. Here's a sample of what I have in my web.config to make sure I'm accessing the proper version of Crystal Reports in my web app...

<assemblies>       
   <add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>      
</assemblies>

I'm sure you could do the same thing to reference your libraryies, you just need to make sure they have a strong naming key so that there is a PublicKeyToken to reference.

Dillie-O
If there is an asm in the gac of the same version, then the gac'ed one will always be used.
StingyJack
+1  A: 

Maybe you create a binding policy that will redirect any request for the assembly you removed from the to gac to the new location

see: [http://msdn.microsoft.com/en-us/library/aa309359(VS.71).aspx][1]

Yep, a BindingRedirect (http://msdn.microsoft.com/en-us/library/eftw1fys.aspx) which can be added anywhere from machine.config up to the application root web.config may well help.
Zhaph - Ben Duguid
+1  A: 

use dependency walker to find out what dependency is missing.

StingyJack
+1  A: 

Or you can use reflector.

How-ever, you also may just want to call up the vendor and ask for help from them. Most of the time these guys take pretty good pride in their products so they will take the time to step you through your problem over email or chat. I just ran into a similar issue with a 3rd party spreadsheet component that I was using and even though the company was in germany, I was able to resolve the issue pretty quickly by having them recompile the component on their end and when they sent me the new dll it worked just fine.

matt_dev
+1  A: 

Probably the most effective way is to run FusLogVW.exe (part of .NET FrameworkSDK, http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx ), which will log every bind failure that happens. That way, you can list failed binding attempts from your app.

Jox