共用方式為


搭配 .NET Framework 遠端處理使用泛型型別

.NET 遠端處理支援在運用二進位序列化的分散式應用程式中使用泛型型別(不支援泛型型別的 SOAP 序列化)。.NET Framework 遠端處理中的自動還原序列化說明遵循需求以提供適當序列化支援的泛型型別。

如需實作泛型介面的範例,請參閱Remoting Generics Technology Sample

當您在組態檔中指定泛型型別時,若要表示型別參數,則必須使用兩組方括弧 ("[]") 來表示所有的巢狀型別引數。如需完整的範例解說,請參閱Using Generics in Remoting Through Configuration

指定泛型遠端型別

下列程式碼範例示範如何在組態檔中指定泛型遠端型別。

<service>
  <wellknown mode="Singleton" type="GenericServer`1[[System.String,mscorlib]], GenericServer" objectUri="genSvr.rem" />
</service> 

請參閱

概念

.NET Framework 遠端處理中的自動還原序列化

Footer image

Copyright © 2007 by Microsoft Corporation. All rights reserved.