Im writing a web service to return the ouput from a console app running on
the server but I can't get it to work. Nothing happens it seems ... The code
looks like this:
[WebMethod()]
public string GetSvnLog(string path, long from, long to)
{
ProcessStartInfo info = new ProcessStartInfo("svn", String.Format("log
{0} --xml --revision {1}:{2}", path, from, to));
info.UseShellExecute = false;
info.CreateNoWindow = true;
info.RedirectStandardOutput = true;
info.StandardOutputEncoding = System.Text.Encoding.UTF8;
Process p = new Process();
p.StartInfo = info;
try
{
p.Start();
return p.StandardOutput.ReadToEnd();
}
catch
{
return null;
}
finally
{
p.Close();
}
}
I assume it is a permission issue but I have no clue how to set the
permissions if it is possible even?
I have set "Execute permissions" to "Scripts and Executables" in the IISM
but that didnt seem to help...
I have tried enabling impersonation in the Web.config and set the user to an
existing user on the server but that only resultet in an error that I didnt
have write permissions to the ASP.NET temp-folder. I then added these
permissions with cacls but then it was the Network Services account that
didnt have the permissions insted...
I have tried setting UserName and Password properties of the
ProcessStartInfo but that didnt do much at all ...
I have searched and searched the web but couldnt find a solution anywhere...
First of all ... is it possible at all to execute a consoleapp in a web
service and have the output returned as a string?
can anyone steer me in the right direction or provide an example of how this
could be accomplished?