简体   繁体   中英

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.)

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM