I have two assemblies / projects with DLL as output: Models and Logic
Inside the Logic DLL I want to create an object of a specific model via reflection (The project is referenced and I am able to manually create an instance)
MyNameSpace.Models.Foo foo = new MyNameSpace.Models.Foo(); // works
Type type = Type.GetType("MyNameSpace.Models.Foo"); // returns null
How can I create an object of MyNameSpace.Models.Foo? Apparently the type does not resolve. How can I fix this?
You could look at using
Activator.CreateInstance. For example: