COM+ サービスを設定する属性の適用
ここでは、System.EnterpriseServices 名前空間の各デザイン時属性の既定値を示します。各属性の既定値を知ることで、コードに不要な属性を記述せずに済みます。メタデータに対する属性の役割を詳しく知りたい場合は、「属性を使用したメタデータの拡張」を参照してください。
各サービス関連属性の既定の使用情報を次に示します。
**属性のスコープ。**属性をメソッドやクラスだけに適用するか、またはアセンブリ全体に適用するかを識別します。
属性未設定時の既定値。コードで属性を省略したときに COM+ によってフィールドに割り当てられる値を表示します。たとえば、クラスで JustInTimeActivationAttribute 属性を省略すると、COM+ によって既定値が False に設定されます。
**属性設定時の既定値。**属性を適用し、属性値を省略したときに COM+ によってフィールドに割り当てられる値を表示します。クラスで JustInTimeActivationAttribute 属性を True に設定する方法を次の例で示します。
Imports System.EnterpriseServices <JustInTimeActivation()> Public Class Account Inherits ServicedComponent Shared Sub Main() End Sub End Class [C#] using System.EnterpriseServices; [JustInTimeActivation] public class Account : ServicedComponent { static void Main() {} }
Makefile.bat
この例を次のようにコンパイルできます。
vbc /t:exe /r:System.EnterpriseServices.dll Demo.vb [C#] csc /t:exe /r:System.EnterpriseServices.dll Demo.cs
サービス関連の属性
サービス関連の属性のスコープと、属性設定時と属性未設定時の既定値を次の表に示します。
属性 | 属性のスコープ | 属性未設定時の既定値 | 属性設定時の既定値 |
---|---|---|---|
ApplicationAccessControlAttribute | アセンブリ | True | True |
ApplicationActivationAttribute | アセンブリ | Library | 既定値なし |
ApplicationIDAttribute | アセンブリ | 生成された GUID | 既定値なし |
ApplicationNameAttribute | アセンブリ | アセンブリ名 | 既定値なし |
ApplicationQueuingAttribute | アセンブリ | 既定値なし | 既定値なし |
AutoCompleteAttribute | メソッド | False | True |
ComponentAccessControlAttribute | クラス | False | True |
COMTIIntrinsicsAttribute | クラス | False | True |
ConstructionEnabledAttribute | クラス | False | True |
DescriptionAttribute | アセンブリ
クラス メソッド インターフェイス |
既定値なし | 既定値なし |
EventClassAttribute | クラス | 既定値なし | FireInParallel = False
AllowInprocSubsribers = True PublisherFilter = Null |
EventTrackingEnabledAttribute | クラス | False | True |
ExceptionClassAttribute | クラス | 既定値なし | 既定値なし |
IISIntrinsicsAttribute | クラス | False | True |
InterfaceQueuingAttribute | クラス
インターフェイス |
False | True |
JustInTimeActivationAttribute | クラス | False | True |
LoadBalancingSupportedAttribute | クラス | False | True |
MustRunInClientContextAttribute | クラス | False | True |
ObjectPoolingAttribute | クラス | False | True |
PrivateComponentAttribute | クラス | 既定値なし | Private |
SecureMethodAttribute | アセンブリ
クラス メソッド |
既定値なし | 既定値なし |
SecurityRoleAttribute | アセンブリ
クラス インターフェイス |
既定値なし | 既定値なし |
SynchronizationAttribute | クラス | False | SynchronizationOption.Required |
TransactionAttribute | クラス | False | TransactionOption.Required
TransactionIsolationLevel.Serializable Timeout = infinite |
参照
サービス コンポーネントの作成 | System.EnterpriseServices | サービス コンポーネントの概要 | サービス コンポーネントの登録 | サービス コンポーネントの例 | 利用可能な COM+ サービスの概要 | 属性を使用したメタデータの拡張 | System.EnterpriseServices