Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Hello Experts,

my application starts from start menu's autostart folder. At times, the startup is blocked because a driver is not yet loaded.

How can my application possibly determine if the driver is loaded at the moment of starting? I could then wait for some time and try again.

The following code should list all available services and drivers:
System.ServiceProcess.ServiceController[] scServices = System.ServiceProcess.ServiceController.GetDevices();


MSDN says that namespace "System.ServiceProvider" is provided by dll "System.ServiceProcess.dll". This file doesn't exist on my PC, even though MSDN also says that it should be included since .NET 1.0.

Am I supposed to download the dll from elsewhere?
Anyone another, easier idea?

Sincearely,


luker
Posted

I might be silly asking you to rechek the path in your system for that specific dll. I used your code line and for that when I had to add reference , I found this is the path in system where "System.ServiceProcess.dll" resides,

"C:\windows\Microsoft.NET\Framework\v2.0.50727\System.ServiceProcess.dll"

This is surprising in case you don't have that dll as it seems to me that indeed it should have been in your system as a part of the framework.

NB: I having my system .NET 2.0 with XP-SP3.
 
Share this answer
 
Did you include the appropriate reference in your project?
 
Share this answer
 
Thanks to Arindam Tewary's answer, I found the necessary dll. It just doesn't seem to be visible to WindowsExplorer's search (F3) feature.

After adding it to my project manually, everything went fine.
 
Share this answer
 
On your 'F3 search function' comment:
The F3 function be default does not search the C:\windows directory. It will default to directories that you explicitly include in the index:
On Vista and up you can type stuff like "name:*dll" in your search box, and it will then limit it's search to the criteria you give.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900