Invalid ServicedComponent
Hi all,
I have the same problem when I tried to register my .Net DLL on a Window Server 2003 SP1, and codes of my test dll is very simple as below. It's strong name dll when I compiled. However, I still have problem to register with this command
c:\regsvcs MyDll.dll
Does anyone see any wrong with my codes.
Regards
John Dang
/* Error *********************************/
The following installation error occurred:
1: Invalid ServicedComponent-derived classes were found in the assembly.
(Classes must be public, concrete, have a public default constructor, and meet a
ll other ComVisibility requirements)
MyCompany.MyDLL.MyServer: Unspecified error
/Code********************************************** **************/
using System;
using System.Reflection;
using System.EnterpriseServices;
[assembly: ApplicationName("MyDll")]
[assembly: Description("Sample Application for Enterprise Services")]
[assembly: ApplicationActivation(ActivationOption.Library)]
namespace MyCompany.MyDLL
{
public class MyServer: ServicedComponent
{
public MyServer(){}
public String GetString()
{
return this.GetType().Assembly.FullName;
}
}
}
|