HighTechTalks DotNet Forums  

Process.Start() fails

ASP.net Security microsoft.public.dotnet.framework.aspnet.security


Discuss Process.Start() fails in the ASP.net Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Mervin Williams
 
Posts: n/a

Default Process.Start() fails - 01-27-2010 , 03:58 PM






I am trying to call a console application from within my ASP.NET application. The strErrors variable returns:

"System.Configuration.ConfigurationErrorsException : Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Access is denied.
---> System.Security.SecurityException: Access is denied."
Here is the code. The executable referred to by the PAMWriterPath points to a custom executable and resides on the same pc. I've given the ASP.NET webapp's Anonymous user account full access to the conole application's directory. Any help would be greatly appreciated.

Process p = new Process();

p.StartInfo.FileName = ConfigurationSettings.AppSettings["PAMWriterPath"];
p.StartInfo.Arguments = "PostSub";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;

p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
bool started = p.Start();

StreamWriter sIn = p.StandardInput;
sIn.AutoFlush = true;
StreamReader sOut = p.StandardOutput;
StreamReader sErr = p.StandardError;

p.WaitForExit();
sIn.Close();

string strErrors = sErr.ReadToEnd();
sErr.Close();

if (strErrors.Length > 0)
bret = false;

sOut.Close();
p.Close();
Thanks in advance,

Mervin Williams

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.