julio9
julio9

Reputation: 221

How can I tell when/what is loading certain Assemblies?

I'm having a problem with an invalidCastException noted here:

InvalidCastException thrown after install on new machine

After some research, I've used the following code to determine what assemblies have been loaded:

        AppDomain MyDomain = AppDomain.CurrentDomain;
        Assembly[] AssembliesLoaded = MyDomain.GetAssemblies();

        foreach (Assembly MyAssembly in AssembliesLoaded)
        {
            Console.WriteLine("Loaded: {0}", MyAssembly.FullName);
        }

That shows me that two assemblies of the program I am working on are loaded. I'm not sure how this occurs, as it doesn't occur on any other machine. Can I tell how/where this assembly is loaded so I can fix it?

Upvotes: 2

Views: 1733

Answers (1)

leppie
leppie

Reputation: 117240

Your best option is to use Fuslogvw.exe (Assembly Binding Log Viewer).

Upvotes: 4

Related Questions