Windows Service Error

Ninnad Jagtap

Active member
Joined
Apr 12, 2005
Messages
35
Programming Experience
Beginner
I m new to windows service . I have written a windows service but when i run it; it show me a alert saying " Cannot start Service from the command line or a debugger. A window Service must First be installed (usng installutil.exe)and then started with the ServiceExplorer,Windows Service Administrator Tool or the NET START Command"
i Command drive i have done the following

D:\Projects\FAXMgmt\bin\Debug>installutil faxmgmt.exe
Microsoft (R) .NET Framework Installation utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Running a transacted installation.
Beginning the Install phase of the installation.
See the contents of the log file for the d:\projects\faxmgmt\bin\debug\faxmgmt.e
xe assembly's progress.
The file is located at d:\projects\faxmgmt\bin\debug\faxmgmt.InstallLog.
Installing assembly 'd:\projects\faxmgmt\bin\debug\faxmgmt.exe'.
Affected parameters are:
assemblypath = d:\projects\faxmgmt\bin\debug\faxmgmt.exe
logfile = d:\projects\faxmgmt\bin\debug\faxmgmt.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the d:\projects\faxmgmt\bin\debug\faxmgmt.exe assembly.
The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the d:\projects\faxmgmt\bin\debug\faxmgmt.e
xe assembly's progress.
The file is located at d:\projects\faxmgmt\bin\debug\faxmgmt.InstallLog.
Committing assembly 'd:\projects\faxmgmt\bin\debug\faxmgmt.exe'.
Affected parameters are:
assemblypath = d:\projects\faxmgmt\bin\debug\faxmgmt.exe
logfile = d:\projects\faxmgmt\bin\debug\faxmgmt.InstallLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the d:\projects\faxmgmt\bin\debug\faxmgmt.exe assembly.
Remove InstallState file because there are no installers.
The Commit phase completed successfully.
The transacted install has completed.


But i am getting the same message

Plz. Advice
Regards
Ninnad Jagtap:confused:
 
You have to add a service installer component to your project for it to
install. Drag it in and it will let you set properties like dependencies, if
the service auto starts, and account information. Without one of these in
your project your service will not install.
 
Hey thankx people i have gona FW but now stuck once again .Non of my Events -- CREATED,CHANGED etc. are fireing plz. advice My. START and STOP are working but non of other events are fireing i checked the event log but cannt find space to move..

private void fwService_Created(object sender, System.IO.FileSystemEventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","In Created Function");
System.IO.FileInfo fi =
new System.IO.FileInfo(e.FullPath);
System.IO.StreamWriter sw;

try
{
fi.MoveTo(Pathout + "\\" + e.Name);
try
{
fi=
new System.IO.FileInfo(Pathout + "\\report.txt");
if (! fi.Exists)
{
sw=fi.CreateText();
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","In Created Function fi.Exits");
}
else
{
sw=fi.AppendText();
}
try
{
sw.WriteLine(e.FullPath + "," + Pathout + "\\" + e.Name);
}
catch
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","Unable to write to the file." + fi.FullName);
}
finally
{
try
{
sw.Close();
}
finally
{}
}
}
catch
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","Unable to create or append to the file " + Pathout + "\\" + e.Name);
}
}
catch
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","Unable to move the file" + e.FullPath + "\\" + e.Name);
}
}
private void fwService_Changed(object sender, System.IO.FileSystemEventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","In Changed");
}
private void fwService_Deleted(object sender, System.IO.FileSystemEventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","In Delete");
}
private void fwService_Renamed(object sender, System.IO.RenamedEventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("C#NetWeb.DirectoryWatcher","In Rename");
}


 
I think i have not written handler for the events so how do i write handler to the events in C#.Net plz. any one advice sssooooooooooooon....... .. .. .

eg i have in vb.net

Private Sub fsw_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles fsw.Created
in C#
privatevoid fwService_Created(object sender, System.IO.FileSystemEventArgs e)
so wheres the handler...

problem is my events are not getting fired


 
Last edited:
Back
Top