A
Amongin Ewinyu
Hi,
I'm trying to create a Windows service programmatically that will do the
following:
- When a user logs on, it will automatically run a service that uses BITS
(Background Intelligent Transfer Service) to check for the most current
version of a file and downloads this version.
I have a wrapper class thats imported as a reference in order for me to be
able to use BITS.
I am able to run and install the service into the SCM but when I attempt to
start the service I get the following message:
"The test service on Local Computer started and then stopped. Some services
stop automatically if they have no work to do, for example, the Performance
Logs and Alerts service."
I then see the following message logged in the Application Event viewer:
"
Service cannot be started. System.IO.FileNotFoundException: File or assembly
name Microsoft.Msdn.Samples.BITS, or one of its dependencies, was not found.
File name: "Microsoft.Msdn.Samples.BITS"
at testBits.startBits.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Msdn.Samples.BITS, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\bits\testBits\obj\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : testBits, Version=1.0.2090.30051, Culture=neutral,
PublicKeyToken=null.
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.Msdn.Samples.BITS, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS.DLL.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS/Microsoft.Msdn.Samples.BITS.DLL.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS.EXE.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS/Microsoft.Msdn.Samples.BITS.EXE.
"
Could someone please tell me where i'm going wrong and/or what I need to
change.
Thanks.
I'm trying to create a Windows service programmatically that will do the
following:
- When a user logs on, it will automatically run a service that uses BITS
(Background Intelligent Transfer Service) to check for the most current
version of a file and downloads this version.
I have a wrapper class thats imported as a reference in order for me to be
able to use BITS.
I am able to run and install the service into the SCM but when I attempt to
start the service I get the following message:
"The test service on Local Computer started and then stopped. Some services
stop automatically if they have no work to do, for example, the Performance
Logs and Alerts service."
I then see the following message logged in the Application Event viewer:
"
Service cannot be started. System.IO.FileNotFoundException: File or assembly
name Microsoft.Msdn.Samples.BITS, or one of its dependencies, was not found.
File name: "Microsoft.Msdn.Samples.BITS"
at testBits.startBits.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Msdn.Samples.BITS, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = C:\bits\testBits\obj\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : testBits, Version=1.0.2090.30051, Culture=neutral,
PublicKeyToken=null.
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.Msdn.Samples.BITS, Version=1.1.0.0,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS.DLL.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS/Microsoft.Msdn.Samples.BITS.DLL.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS.EXE.
LOG: Attempting download of new URL
file:///C:/bits/testBits/obj/Debug/Microsoft.Msdn.Samples.BITS/Microsoft.Msdn.Samples.BITS.EXE.
"
Could someone please tell me where i'm going wrong and/or what I need to
change.
Thanks.