I am trying to use Type.GetType and pass “caLibClient.entity.Web2ImageEntity” full class name. The caLibClient.entity is namespace, located in separated assembly (caLibClient) and added to program reference assemblies list. The Type.GetType always return Null when I call it from program, what is wrong?
I am trying to use Type.GetType and pass caLibClient.entity.Web2ImageEntity full class name. The caLibClient.entity
Share
You need to add the assembly name as well, since your type isn’t in the executing assembly (nor mscorlib.) So the call should be:
From the
Type.GetType()docs:From the docs for
AssemblyQualifiedName, this is a sample name:Update: If you’re already referencing the assembly in your project, and know at compile-time what the type-name is, you’re better off saying
since now you don’t need to search for the type at run-time; the compiler will do everything for you.