What?s the command code you?re sending?
According to the documentation, the range of valid command ids are 128 ?
256. It also looks as if you set the AutoLog property to true on your
service you should see an entry in the event log for every command sent to
your service regardless of success or failure. That may provide some
additional information.
/Mats
From: padnug@xxxxxxxxxxxxxxx [mailto:padnug@xxxxxxxxxxxxxxx] On Behalf Of
John P. Greiner
Sent: Monday, June 26, 2006 8:21 AM
To: padnug@xxxxxxxxxxxxxxx
Subject: [padnug] Cannot Control a Service - Access Denied - WHAT?
Hello all, hope you were able to stay cool this weekend. I figure the
only reason to come to work today is for the free air conditioning!
On to business:
I have written a service that I now need to write some sort of
administration program for. In my service, I have created an event log
which for now I am using as my debugger. I have overridden all of the
standard stuff: OnStart, OnStop, OnContinue, OnCustomCommand, OnPause,
OnShutDown, OnSessionChange <-- Don't know what this is.
In my Admin Project I have a simple form that, using a Service
Controller can Stop, Start, Pause and Resume the service, but when I try
to send the service a custom command I get the error: Cannot control
DBAuthentication service on computer '.'. The exception details are
below:
System.InvalidOperationException was unhandled
Message="Cannot control DBAuthentication service on computer '.'."
Source="System.ServiceProcess"
StackTrace:
at System.ServiceProcess.ServiceController.ExecuteCommand(Int32
command)
at
Database_Authentication_Admin.Form1.cmdSendCommand_Click(Object sender,
EventArgs e) in C:\Documents and Settings\jgreiner\My Documents\Visual
Studio 2005\Projects\Database Authentication Admin\Database
Authentication Admin\Form1.cs:line 124
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.U
nsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at Database_Authentication_Admin.Program.Main() in C:\Documents
and Settings\jgreiner\My Documents\Visual Studio 2005\Projects\Database
Authentication Admin\Database Authentication Admin\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
My question(s) are:
Is there something wrong with my service or with my Admin Program?
How can I fix this?
Thanks in advance,
John P. Greiner
Key Knife, Inc.
503.403.2013
PLEASE DO NOT read, copy, or disseminate this communication unless you are
the intended addressee. This e-mail communication may contain confidential
and/or privileged information intended only for the addressee. If you have
received this communication in error, please contact Key Knife, Inc. at
503-403 2000 for North America, or +43 7442/ 53350 for Europe.
Also, please notify the sender immediately via e-mail, by replying to this
message, that you have received the communication in error.
Thank you.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~->
|