Tuesday, August 21, 2007

Application failed to initialize properly(0xcC000142). Press OK to terminate the application

Hi,

            I am having a small issue. I am calling a console application from ASP.NET 2.0 website. Below is my code,

string strPassword = Convert.ToString("Password");

System.Security.SecureString ssPassword = new System.Security.SecureString();

foreach (char chr in strPassword)
{
          ssPassword.AppendChar(chr);
}

System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("Path of EXE");
info.UseShellExecute = false;
info.Arguments = "ARGUMENTS";
info.UserName = Convert.ToString("UserName");
info.Password = ssPassword;
info.Domain = Convert.ToString("Domain");

System.Diagnostics.Process.Start(info);

Fig - (1) code for calling exe from asp.net

            When I run (by pressing F5 from VS) it works fine and console application loads. However once I have deployed the application console application does not load and gives error "Application failed to initialize properly(0xcC000142). Press OK to terminate the application".
                   I have used proper credential(Machine's Admin User Name and Password on which web application is deployed. Console application is on same machine).

Early response is highly appreciated.   :)

2 comments:

Anonymous said...

Hi, did you find decision for the issue?

Anonymous said...

Hi. I having the same problem but I can run my application with the user name of ASP.NET. Please tell me if you can fix this.


thank you