I am trying to use System.Activator.CreatInstance to create an object based on typeName. I am using the following code:
Object DataInstance = System.Activator.CreateInstance(
System.Reflection.Assembly.GetExecutingAssembly().FullName,
"CMS.DataAccess.SQLWebSite");
IWebSite NewWebPage = (IWebSite)DataInstance;
SQLWebSiteimplements IWebSite. But I get the following error: "Unable to overlay an object of type" System.Runtime.Remoting.ObjectHandle "on type" CMS.DataAccess.IWebSite "." Any ideas I'm wrong about?
source
share