Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Probem in launching new process from a c# .net windows service.
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 7th April 01:33
nicky
External User
 
Posts: 1
Default Probem in launching new process from a c# .net windows service.



hi, all
I am using .net framwork v1.1.4322 and get an error in the following test:
I have a c# console application, basically, it is empty:
static void main(string[] args)
{
System.Console.WriteLine("Started...");
System.Threading.Thread.Sleep(60*1000); // Sleep one minute and then
exit.
}

And then I create a c# windows service and in this services, just from 1 to
150 to create process,
protected override void OnStart()
{
string strProgram = @"c:\ConsoleTest.exe";
for(int i = 0 ; i < 150; i++)
{
System.Diagnostics.Process myProc =
System.Diagnostics.Process.Start(strProgarm, "");
}
}
And then, open the windows Task Manager to see how many process will be
created. Start the service, once it reaches about 70, it starts to get two
errors.
ConsoleTest.exe Application Error
The exception unknow software exception(0xc06d007e) occurred in the
application at location 0x7c59bbf3.
ConsoleTest.exe Application Error
The application failed to initialize properly(0xc0000142). click on ok to
terminate the application.
And then in Windows Event Viewer, I saw there are serveral error,
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. The following
information is part of the event: .NET Runtime version 1.1.4322.573- .NET
Framework Initialization Error:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorwk s.dll could not be loaded.

I also tried to launch process from a c# window Form program, it does not
have any problem. It only happens in service. And I don't know how to debug
this problem either, becuase it is in service.
Thanks and have a great weekend!
  Reply With Quote


  sponsored links


2 7th April 01:34
nicky
External User
 
Posts: 1
Default Probem in launching new process from a c# .net windows service.



Is this possible that there are some limitation on how many processes can be
created from a service?
  Reply With Quote
3 7th April 10:04
willy denoyette [mvp]
External User
 
Posts: 1
Default Probem in launching new process from a c# .net windows service.


No, the problem is that you spend too much time in your OnStart method.
This method is meant to initialize service after which it spawns another
thread that actually runs the service, once this is done the OnStart
returns, when you fail to return within 30 seconds the SCM will consider the
service to have failed to start properly.

Willy.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666