GetReferencedAssemblies doesn't return all assemblies

前端 未结 2 658
挽巷
挽巷 2020-12-16 10:45

I have the following code inside a Form, and am attempting to find a way to load a project assembly referenced by the form called DataObjects. Using the follow

相关标签:
2条回答
  • 2020-12-16 11:13

    The compiler will not include assembly references in the output assembly that are not actually used in code.

    Only assemblies that are used from code will be referenced in the output assembly.

    0 讨论(0)
  • 2020-12-16 11:21

    Could you please check the assembly's manifest to see what is referenced here?

    C# compiler tends to remove referenced assemblies from the manifest if they are not used. Therefore if you don't refer to any type from assembly B or refer only to constants from assembly B (that are inlined by complier) then you will not have this references.

    0 讨论(0)
提交回复
热议问题