By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

WCF Impersonation Process.Start Fails

P: n/a
Hi, I have a WCF Service hosted by a Windows Service using Impersonation. The
impersonation seems to be configured correctly, in that
Thread.CurrentPrinipal is the user calling the service, not the local system
account. However when I call Process.Start the process does not seem to be
started by the requested user. This code runs fine without impersonation (ie:
if I change the host user of the service to myself).

Any ideas on what I should be doing? Code attached.

Thank you,

Jason Lind

[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public string PerformPrintLayoutHtml(System.Xml.Linq.XElement rpt)
{
string data = null;
try
{
string baseDirectory =
ConfigurationManager.AppSettings["BaseDirectory"];
Guid reportId = Guid.NewGuid();
rpt.Save(baseDirectory + reportId.ToString() + ".rpt");
Process cmd = new Process();

cmd.StartInfo.FileName = baseDirectory +
"eGlue.NavigatorCmd.exe";
cmd.StartInfo.Arguments = "-f \"" + baseDirectory +
reportId.ToString() + ".rpt\" -e \"" + baseDirectory +
"Debug.err\" -l \"" + baseDirectory + "Debug.log\" -htm
\"" + baseDirectory + reportId.ToString() + ".html\" -timeout 120";
cmd.Start();
cmd.WaitForExit();
var html = File.Open(baseDirectory + reportId.ToString() +
".html", FileMode.Open);
using (StreamReader reader = new StreamReader(html))
{
data = reader.ReadToEnd();
}
}
catch (Exception ex)
{
data = ServiceSecurityContext.Current.WindowsIdentity.Nam e;
data += ex.Message;

}
return data;
}
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.