windows services

V

Vuong

I just wrote a simple host application. Already tested.

After that i change it to a service. (I add new project to the exist host
application, copy code from this host application to OnStart() of the new
project )

Build with no error, use installutil to register it to Services. (Success)
However, I can't not start this services.

Error 1083 : the executable program that this service is configured to run
in does not implement the service.

Any help would be appreciate. If this is not clear enough (my poor english),
i can explain it again


Here my code

Host Application : (console)
EventLog myLog = new EventLog();

myLog.Source = "ListHost";

RemotingConfiguration.Configure(@"../../ListHost.exe.config");

myLog.WriteEntry("Configuration from ListHost.exe.cfg successful");

System.Console.WriteLine("Press [Enter] to exit...");

System.Console.ReadLine();

my XML file : (i copied my xml file and rename it for service into
windows\system32)

<configuration>

<System.Runtime.Remoting>

<application name="ListServer">

<service>

<wellknown mode="Singleton"
type="ListServer.CompanyList,ListServer" objectUri="CompanyLists"/>

</service>

<channels>

<channel ref="http" port="8080"/>

</channels>

</application>

<debug loadTypes="true" />

</System.Runtime.Remoting>

</configuration>

my OnStart in ListService.h :
EventLog myLog = new EventLog();

myLog.Source = "ListHost";

try

{

RemotingConfiguration.Configure("ListService.exe.config");

myLog.WriteEntry("Configuration from ListHost.exe.cfg successful");

}

catch (Exception e)

{

myLog.WriteEntry("Failed to configure host application: " +
e.Message,System.Diagnostics.EventLogEntryType.Error);


}


Thanks,
Nos
BG
 
N

Nicholas Paldino [.NET/C# MVP]

Vuong,

I would check the documentation for the ServiceBase class. It will tell
you how to create a service, as well as define the entry point to run your
service(s).

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top