G
Guest
Here is what I am trying to get to:
I have a console exe that grabs information from the network and writes to
an XML file on the website that web pages then render information from. The
console will be scheduled to run through windows scheduler. However,
sometimes a user may need the information sooner so he/she needs to kick off
the console exe.
The new Process.Start looked teasingly simple. It had a username/password on
the start info. Seemed simple enough.
We created a user with Read/Write/Execute to the folder of the EXE and the
destination folder of the XML files. Both folders are underneath the website.
The network shares are accessable through read-only shares to Everyone.
I get this error: "The application failed to initialize properly
(0xc0000142). Click on OK to terminate the application. when executing it
from ASP.NET.
The dev machine is XP Pro with IIS 5.1 using the default user.
I went so far as to create an empty .NET 2.0 console exe and we get the same
error.
We've logged in to XP as this other credential and can run both EXEs with no
error.
public static void RefreshContent(string filePath)
{
Process processor = new Process();
processor.StartInfo.FileName = filePath;
processor.StartInfo.Arguments = "/q"; //quiet mode
processor.StartInfo.CreateNoWindow = true;
processor.StartInfo.WorkingDirectory =
System.IO.Path.GetDirectoryName(filePath);
processor.StartInfo.UseShellExecute = false;
processor.StartInfo.LoadUserProfile = false; //true also failed.
processor.StartInfo.UserName = "RefreshContentFromWeb";
SecureString password = MakeSecureString("0a8fsud");
password.MakeReadOnly();
processor.StartInfo.Password = password;
processor.Start();
processor.WaitForExit(1000 * 60 * 5); //5 minutes.
}
private static SecureString MakeSecureString(string passwordString)
{
SecureString password = new SecureString();
foreach (char x in passwordString)
{
password.AppendChar(x);
}
password.MakeReadOnly();
return password;
}
I have a console exe that grabs information from the network and writes to
an XML file on the website that web pages then render information from. The
console will be scheduled to run through windows scheduler. However,
sometimes a user may need the information sooner so he/she needs to kick off
the console exe.
The new Process.Start looked teasingly simple. It had a username/password on
the start info. Seemed simple enough.
We created a user with Read/Write/Execute to the folder of the EXE and the
destination folder of the XML files. Both folders are underneath the website.
The network shares are accessable through read-only shares to Everyone.
I get this error: "The application failed to initialize properly
(0xc0000142). Click on OK to terminate the application. when executing it
from ASP.NET.
The dev machine is XP Pro with IIS 5.1 using the default user.
I went so far as to create an empty .NET 2.0 console exe and we get the same
error.
We've logged in to XP as this other credential and can run both EXEs with no
error.
public static void RefreshContent(string filePath)
{
Process processor = new Process();
processor.StartInfo.FileName = filePath;
processor.StartInfo.Arguments = "/q"; //quiet mode
processor.StartInfo.CreateNoWindow = true;
processor.StartInfo.WorkingDirectory =
System.IO.Path.GetDirectoryName(filePath);
processor.StartInfo.UseShellExecute = false;
processor.StartInfo.LoadUserProfile = false; //true also failed.
processor.StartInfo.UserName = "RefreshContentFromWeb";
SecureString password = MakeSecureString("0a8fsud");
password.MakeReadOnly();
processor.StartInfo.Password = password;
processor.Start();
processor.WaitForExit(1000 * 60 * 5); //5 minutes.
}
private static SecureString MakeSecureString(string passwordString)
{
SecureString password = new SecureString();
foreach (char x in passwordString)
{
password.AppendChar(x);
}
password.MakeReadOnly();
return password;
}