A. G.
A. G.

Reputation: 159

How can you find which .NET project reference is transitively loading another assembly?

I've got a project that I'm trying to deploy to another PC, but the installation fails because it requires an assembly to have been installed in the GAC. But that assembly (System.ServiceModel.DomainServices.Hosting 4.0.0.0) has no relevance to my project so I'm trying to remove both it and the direct reference that loads it.

My project --directly depends on--> Unknown reference --indirectly depends on--> System.ServiceModel.DomainServices.Hosting 4.0.0.0

How can I find out which of the direct references in my project is indirectly loading this useless DomainServices assembly? I can't see a way to do it using reflection...

(This is a general question, but if it helps I'm using C# on .NET 4.0, Visual Studio 2010, and ClickOnce to deploy the project.)

Upvotes: 3

Views: 591

Answers (2)

Richard Friend
Richard Friend

Reputation: 16018

You could try turning on Fusion Logging, this will enable you to view all of the assembly load failures.

Back to Basics: Using Fusion Log Viewer to Debug Obscure Loader Errors

Upvotes: 6

fejesjoco
fejesjoco

Reputation: 11903

Try to find it with Reflector. Also note that the Assembly class has a GetReferencedAssemblies method, so you should be able to find it with reflection, too.

Upvotes: 0

Related Questions