Suppose you are provided with the assembly Class.dll, composed of the following simple code:
namespace ClassLibrary
{
public class Class
{
}
}
And consider another project with the above Class.dll as a reference to the project and with the following code:
Assembly assembly = Assembly.LoadFrom(@"Class.dll");
Type reflectedType = assembly.GetType("ClassLibrary.Class");
Type knownType = typeof(ClassLibrary.Class);
Debug.Assert(reflectedType == knownType);
The statement fails, and I don't understand why.
The statement succeeds if I replace ClassLibrary.Class with, say, System.Text.RegularExpressions.Regex and Class.dll with System.dll, so I assume this has something to do with the project properties? maybe some compiler?
Thank you in advance
source
share