C
charlie
Sorry for the cross-posting but I really need some help here. I posted
before but didn't get any responses so I am trying my luck again.
I have a fairly simple scenario that is complicated by the ASPNET userid
security model and my need to access network file shares.
We currently have an executable that performs a data merge with data from a
database into some RTF documents. Then, it takes the RTF doc and converts
it to a PDF doc. All this works fine from the command line. It also works
fine when everything (RTF doc and resulting PDF doc) reside on the webserver
machine.
However, if I change the location of the RTF doc from the local machine to a
network file share, I get file access exceptions. I understand that this is
because the ASPNET account is local and does not have network permissions.
However, I have tried impersonating and that does not work either. I have
impersonated at the application level using Web.Config file and at the code
block level using the WindowsImpersonationContext object.
The sequence of processes is:
1) Call the web service to perform the Document Merge
2) The web service makes a call to a Remoting Server
3) The MegerEngine.exe program is executed from the Remoting server
4) Control is passed back to the web service and then confirmation is
returned to the calling user.
The code I am executing is:
Process p = new Process();
p.StartInfo.FileName = @"c:\temp\MergeEngine.exe";
p.StartInfo.Arguments = @"c:\temp\rtfmerge\test1.ini";
p.Start();
p.WaitForExit();
The only difference between successful execution and failure is access a
network file share. The reference to the network file share is in the INI
file that is passed as a parameter to MergeEngine.exe.
I have also tried using asserts but that has not proven successful either.
I would greatly appreciate any insight.
Charlie
before but didn't get any responses so I am trying my luck again.
I have a fairly simple scenario that is complicated by the ASPNET userid
security model and my need to access network file shares.
We currently have an executable that performs a data merge with data from a
database into some RTF documents. Then, it takes the RTF doc and converts
it to a PDF doc. All this works fine from the command line. It also works
fine when everything (RTF doc and resulting PDF doc) reside on the webserver
machine.
However, if I change the location of the RTF doc from the local machine to a
network file share, I get file access exceptions. I understand that this is
because the ASPNET account is local and does not have network permissions.
However, I have tried impersonating and that does not work either. I have
impersonated at the application level using Web.Config file and at the code
block level using the WindowsImpersonationContext object.
The sequence of processes is:
1) Call the web service to perform the Document Merge
2) The web service makes a call to a Remoting Server
3) The MegerEngine.exe program is executed from the Remoting server
4) Control is passed back to the web service and then confirmation is
returned to the calling user.
The code I am executing is:
Process p = new Process();
p.StartInfo.FileName = @"c:\temp\MergeEngine.exe";
p.StartInfo.Arguments = @"c:\temp\rtfmerge\test1.ini";
p.Start();
p.WaitForExit();
The only difference between successful execution and failure is access a
network file share. The reference to the network file share is in the INI
file that is passed as a parameter to MergeEngine.exe.
I have also tried using asserts but that has not proven successful either.
I would greatly appreciate any insight.
Charlie