2
可能是一个基本的问题:什么是使用AppDomain.CreateInstance时的实例包装?
我通过这一去,
secondDomain.CreateInstance("AssemblyA", "AssemblyA.Demo", true,
System.Reflection.BindingFlags.CreateInstance, null,
new object[] { 7, 3 }, null, null);
而且看了看评论的形式解释。
// Returns:
// An object that is a wrapper for the new instance specified by typeName. The
// return value needs to be unwrapped to access the real object.
MSDN:AppDomain.CreateInstance Method。
什么是在这种情况下对象的包装?为什么使用这个?如何解开这个?
可能的重复:http://stackoverflow.com/questions/889160/what-is-a-wrapper-class – 2013-02-21 10:10:35
回答你的问题如何解开。您可以使用CreateInstanceAndUnwrap方法代替它。 – Evelie 2013-02-21 10:12:08
@defaultlocale:我不认为这是重复的。他的问题是关于该方法的具体问题。你所关联的问题一般是关于包装类的问题。完全不同。 – 2013-02-21 10:12:20