Link to home
Start Free TrialLog in
Avatar of Bharpinder Singh
Bharpinder Singh

asked on

Unable to start windows service

Developing a c# webservices in sharpDevelop tool but getting error message
"Cannot start service from the command line or debugger. A winwows Service must first be installed(using installutil.exe) and then started with the ServerExplorer, Windows Services Afministrative tool or the NET START command."
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bharpinder Singh
Bharpinder Singh

ASKER

Sorry its windows service
Yupp then follow the guidance provided above. As you mentioned the error I thought it has to be a Windows Service - I asked 'cause some scenarios require you to host a WCF Service using a Windows Service so thought I will double check.
actually, i am not expert in c# i just started to make a utility with sharpDevelop tool.
I think with installutil  command , we need installutil.exe installed on every system where i will execute my script. right?
i want any solution by which user have not to be install any extra software to run my code.
there are many software like antivirus whose windows service installed without any dependance (like installutil)
No. That is why I always strongly recommend learning things in a right way. You can take liberty of skipping topics once you have gained better insights in a given topic. C# is good but it is better to first understand .Net Framework why it exists, what it does and how it works.

Anyways to answer your concern, InstallUtil is a part of .net framework so any code that you write in C# is going to need .Net Framework and hence it will have InstallUtil available to you. Also, you will build an installer to deploy your components - if not a batch script that will take care of installation.
No you are wrong again. There is not a single software that will be able to install without any dependency - I can bet my life on that. Everything depends on something. The softwares you are mentioning does install dependencies behind the scenes. Just because you do not see things happening in action does not mean they are not happening. I think I am wrong to suggest understanding .net Framework in my above comment, you should start from very basics. Maybe Operating System fundamentals (It still depends on your requirements but that's my suggestion - understand the fundamentals - other things will be EASY).
Ok, I got it.
I am web developer but new in windows scripting.
I just want to make a script which can read usb device on plugin and popup one message.
So i decided to do by self instead of hiring any experts.
That is how mostly even I like to do things. My suggestion on this approach- Keep the mind open for possibilities(Both Good and Bad) and
do some homework on the tech you are aiming.

Also I was wondering, if you need to detect a cam on client's machine how about using built-in HTML5 features or fall-back to Flash plugin?
I don't know your exact requirements but it is worth checking.
The requirement is not related to web or html.
It should work without opening borwser.
Here is actual task i have:
1) Install .exe file into the system
2) Windows service automatically starts and check USB webcam for plugin or unplug
3) Every event writes a log file or popup a custom message.

Your suggestion will be very helpful.
Yupp. These are definitely a Windows Service requirements. You have made a good call by choosing Windows Service.
Now, don't worry about the installation that we will automate by script or installer - as long as user agrees to execute it we will be ok.
Let me know once you are able to install and start the service.
now system required .Net Framework to run c# script.
Yupp. As I mentioned earlier compatible version of. Net will be needed. Can you tell me which O/S you are targeting?
Normally xp and windows 7
Supporting XP is not possible and I will suggest to avoid XP at all cost - it does not matter if it was the best thing that happened to the world around 17 years back but the O/S is not supported hence getting results on Windows XP will be a big challenge.

Windows 7 is a different story it is in extended support mode till 2020 so we are ok till then.

Now to avoid these challenges of having proper dependencies and their installation I suggest you build an installer for your solution. There are many free such installation solutions available (For example, InnoSetup, Nullsoft Installation System).
still running one question in mind.
My system doesn't have .NET framework and installed one application named 'USB disk security'
it popup on USB plugin to scan.
Question is in which language/framework it developed ?
It has windows service too..
Mostly VC++
And even then you need VC++ runtime redistributable package. Why the concern about installing a runtime?
Author has not responded in a while but the answer to his original question is posted. If author needs more information I am happy to help.