Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# MarshallByRefType_C#_.net - Fatal编程技术网

C# MarshallByRefType

C# MarshallByRefType,c#,.net,C#,.net,我尝试了一个示例,但得到了错误: Error 1 The type or namespace name 'MarshalByRefType' could not be found (are you missing a using directive or an assembly reference?) C:\Dropbox\development\snipplets-examples\dot.net\appdomain\MyAppDomain\MyAppDomain\Program.c

我尝试了一个示例,但得到了错误:

Error   1   The type or namespace name 'MarshalByRefType' could not be found (are you missing a using directive or an assembly reference?)  C:\Dropbox\development\snipplets-examples\dot.net\appdomain\MyAppDomain\MyAppDomain\Program.cs  34  13  MyAppDomain
代码:


MarshalByRefType类的定义在您链接的页面中给出。

是否应该是
MarshalByRefObject
?或者您的
MarshalByRefType
是您定义的类型,并且
:MarshalByRefObject
// Create an instance of MarshalbyRefType in the second AppDomain. 
// A proxy to the object is returned.
MarshalByRefType mbrt = 
            (MarshalByRefType) ad2.CreateInstanceAndUnwrap(
                exeAssembly, 
                typeof(MarshalByRefType).FullName
            );