ApplicationNameAttribute(String) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the ApplicationNameAttribute class, specifying the name of the COM+ application to be used for the install of the components.
public:
ApplicationNameAttribute(System::String ^ name);
public ApplicationNameAttribute (string name);
new System.EnterpriseServices.ApplicationNameAttribute : string -> System.EnterpriseServices.ApplicationNameAttribute
Public Sub New (name As String)
Parameters
- name
- String
The name of the COM+ application.
Examples
The following example illustrates the use of this attribute to mark a ServicedComponent class.
[assembly:ApplicationName("Calculator")];
[assembly:ApplicationActivation(ActivationOption::Library)];
[assembly:System::Reflection::AssemblyKeyFile("Calculator.snk")];
public ref class Calculator: public ServicedComponent
{
public:
int Add( int x, int y )
{
return (x + y);
}
};
using System;
using System.EnterpriseServices;
[assembly: ApplicationName("Calculator")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: System.Reflection.AssemblyKeyFile("Calculator.snk")]
public class Calculator : ServicedComponent
{
public int Add (int x, int y)
{
return(x+y);
}
}
Applies to
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.