c# - Running Rake from a .NET windows service -


I am a developer on the OSSS project which is the other OSS Creating projects determines to reduce the pain I <<>

We make a ruby ​​gem horn like experience One of Horn's many challenges is to deal with all the different build engines like Nanhent, Powerhale, MSBield and Rack, which is the point of this post.

There are 2 expressions in the horn, it runs in the form of a CMD line tool and it also runs as a window service where it creates all the different packages that can be downloaded from the website.

Some OSS projects use rakes to create their source code, which ultimately gives me the rank.

I can not get the rake process to run from the Windows service, while the exact same code can start the rake process without any problems while running from the command line. The reason for this is that the rake can be run with the CMD line tool because it is connected to a window, although I can say right. No exception is thrown, but this process does not start.

The funny thing is that every second. Axc works fine and this is the only rack that is causing the problem. Public IProcess GetProcess {string pathToBuildTool, string cmdLineArguments, string working guide paths} {var psi = new ProcessStartInfo (pathToBuildTool, CmdLineArguments) {UseShellExecute = false, RedirectStandardOutput = true, Working directory = work directory path, logic = cmdline arguments}; Return the new diagnostics process (process start (PE)); }

Is there any problem as there is a problem?

I compiled myself and examined it.

On my machine, the Horn service actually starts the process of Ruby to run the rake, but the process immediately goes out with an error. I create the process when filtering for the path of "Ruby" The last result that the process monitor had used to monitor was that the horn was not able to build with the Rackfile.

After some further investigation, I was playing a little bit how the horn produces processes. I found that the build actually runs on my machine when I do not even redirect StandardError to StandardOutput . Public IProcess GetProcess (string) PathToBuildTool, String cmdLineArguments, String Working Directory Path) {var psi = new ProcessStartInfo (pathToBuildTool, cmdLineArguments) {UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, Working Directory = workDirectoryPath, Arguments = cmdLineArguments}; Return the new diagnostics process (process start (PE)); }

I changed the diagnostic process to output both messages from StandardOutput and StandardError Is:

  public string GetLineOrOutput () {return process. Standard Optical Readline (?) ?? Process.StandardError.ReadLine (); }  

The following result is the result of the last message in the Horn Service log:

  Horne has completed the MSPE installed  < / Pre> 

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -