Today I want to write a windows serivce application. When I finished the code and I wanted to start the serivce, and I get a error, just like below:

C:\Documents and Settings\Elliot>net start msiserver
The Windows Installer service is starting.
The Windows Installer service could not be started.
 The service did not report an error.
More help is available by typing NET HELPMSG 3534.

C:\Documents and Settings\Elliot>net helpmsg 3534
The service did not report an error.

This error is very strange.  After about 30 minutes, I got the solution as below:

in my case, this was permissions on a log file. If your program code will wrtie some data to a file, and you never change the program execute directory( the service program's default execute directory is C:\windows\system32), and you'll get a error that you have not permission to write to system directory.  However, how to find this error? I looked at the event log which pointed me to this issue. specifically:
1. right click my computer
2. click manage
3. goto: computer management -> systeme tools -> event viewer -> application
4. look for a Red X and type “error”, then make sure the “source” is the same service that you have trouble starting, read the information and error and look for the exact file causing the problem.  use the information in the event to find another solution.

 

So, you have two solutions:
1. You can modify your code: Do not write anthing to the file.
2. Change your execute directory to your own debug/release directory, the code just like :
            string assemblyPath =
                Path.GetDirectoryName(Assembly.GetAssembly(typeof(Program)).CodeBase).Substring(6);
            Directory.SetCurrentDirectory(assemblyPath);

Good Luck!

Reference:
1. Error: More help is available by typing NET HELPMSG 3534: http://www.intelliot.com/blog/2006/02/more-help-is-available-by-typing-net-helpmsg-3534/
2. comments on how to debug with windows service :  http://www.cnblogs.com/liji0307/archive/2006/05/16/401355.html

转载请注明: 转载自Knight.Liao's Tale
本文链接地址: Error: More help is available by typing NET HELPMSG 3534


我猜您可能还喜欢: