Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a App with pjsip4net (it is an open source project SoftPhone) .
I add AutoMaper.Net4 DLL to references in the project .
but when I run this code to get project's assemblies AutoMapper.Net4 it is not in list . why ?

C#
AppDomain currentDomain = AppDomain.CurrentDomain;
Assembly[] assems = currentDomain.GetAssemblies();


What I have tried:

How to use AutoMapper.Net4 DLL in my project
Posted
Updated 13-Sep-16 2:18am

1 solution

If you refer to the documentation, AppDomain.GetAssemblies Method (System)[^], it reads, "Gets the assemblies that have been loaded into the execution context of this application domain."

Adding a reference does not actually load the assembly. You would have to be using it in code somewhere for it to get loaded.

If you added a reference in your project then don't use Reflection to load it, just create a new instance of the class and go from there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900