benwu's WebLog

Having assembly binding problems?

If you're getting assembly load errors and cannot figure out why, you can use the fusionlog viewer to help figure it out.  The fusion log will show exactly how all managed assemblies were resolved.

Check out:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrffusionlogviewerfuslogvwexe.asp

This includes retargeted assemblies.  For example, if you run your device application on the desktop, compact framework assemblies are “retargeted” to desktop versions -- but only if fusion policy was applied. 

If you get a cryptic assembly load error when trying to run your app, try using the above log viewer.  It can save you a few hours.

 

Published Monday, February 16, 2004 11:43 AM by benwu

Comments

 

Ivana Vackoff [MSFT] said:

Or how about fixing the actual problem, BETTER ERROR MESSAGES.

February 16, 2004 12:03 PM
 

benwu said:

The problem isn't always a poor error message, Mr. "Vackoff". Sometimes you need to see the probing paths to figure out how the assembly is being located. Load, LoadFrom, and LoadFile all use slightly different hueristics for loading assemblies. Many customers also will place extra probing paths in thier .exe.config file. Reflection has no idea where an assembly is SUPPOSED to come from -- only that it did not resolve it appropriately. When looking at the logs and seeing the probe paths and results per path, the problem is much easier to identify.
February 16, 2004 12:08 PM
 

UnhappyCustomer said:

"Customers" have no freakin' idea what an .exe.config file is, nor do they know about XML or anything. To be honest, even developers are having a hard time understanding this GAC/Fusion versioning nightmare. "Customers" get stupid error messages like "mscoree.dll not found", never look at you app again and blame it all on the app developer.
February 16, 2004 3:39 PM
 

Ivana Vackoff [MSFT] said:

No no they blame Windows!!!
February 16, 2004 7:24 PM
 

Ivana Vackoff [MSFT] said:

Alot of customers dont even know what a Control Panel is nevermind a log file (especially one that is burried deep in teh system and crptic) or worse, the event log.

To Quote Alien the movie

"Did IQs just drop when I was away".
February 16, 2004 10:26 PM
 

benwu said:

"mscoree.dll not found" sounds like the .Net framework was not installed on thier system. If you have a repro or a specific instance of this problem with enough detail, I can try to get it resolved for you.

"Customers" in this context means app developers -- not the consumers of the app. But I agree with both of you -- there are both a lot of app developers and consumers who do not know what an .exe.config is -- and the end user (as opposed to the app develepor) getting these cryptic error messages is terrible.

My suggestion was solely geared towards devs who are testing thier app and encountered an error. Should error messages be explicit? Yes. Can an error message give you as much as a trace log? No. That is why the fusion log is so useful -- you can parse through the (sometimes) complex logic fusion is using.
February 17, 2004 4:27 AM
 

Ivonna Vackoff [MSFT] said:

In todays climate, I wouldnt trust a dev to know what a config file is either. :D
February 17, 2004 6:47 AM
 

Jean-Marc said:

I'm trying to create a WebService that uses a managed DLL that in turn uses unmanaged C++ DLLs.
I can't get the unmanaged DLLs to be copied in the assembly cache. I've tried everything... except the right thing, of course. I'm lost. Any help ?
Thanks
June 3, 2004 2:33 AM
 

benwu (msft) said:

Are the unmanaged dll's COM objects? You should be able to either register the native dll and use managed interop wrappers or place the native dll in the system path (if its not a COM object) to allow the webservice to find it. I'm no expert in the web space, but have you tried this?
June 3, 2004 5:14 AM
 

Jean-Marc said:

No, they are not COM objects. Plain old C++ DLLs.
I can put them in the System32 directory, and it works, but it is Wrong, I guess.

As for "registering the native DLL and use managed interop wrappers"... well I guess that I'll have to google to know what it means :-/

Thanks
-- JM
June 3, 2004 6:21 PM
 

Having assembly binding problems? said:

November 27, 2007 6:26 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker