I am trying to figure out how to run a bash shell using .NET Core. Specifically, I want to run a bash shell, run a dotnet [path to dll] command and pass commands to the dll. I tried looking through the test classes in System.Diagnostics.Process but I couldn't wrap my head around it. :(
What I hope to achieve is something like on the .NET Framework:
Process.Start("bash dotnet a.dll start")
Please let me know if I'm asking the question in the appropriate area. :)
I am running Mac OSX El Capitan 10.11.6
Thank you!
Have you tried using the Process.Start method? It should work fine. This command (bash dotnet a.dll start) doesn't look valid to me (you might want bash -c), but other than that, there shouldn't be any problems.
@mellinoe Yeah, that command probably isn't valid as it was just pseudocode. I haven't tried anything yet. What would I pass in as the argument?
The easiest option is just to call this method: https://msdn.microsoft.com/en-us/library/h6ak8zt5(v=vs.110).aspx. The same exact method is available on .NET Core.
Examples:
C#
Process.Start("bash", "-c dotnet --info");
Process.Start("dotnet", "a.dll start");
@akcorp2003 Did the proposed methods work for you?
@Priya91 Process.Start("dotnet", "a.dll"); will work, I have done that all the time.
@Priya91 Sorry, I was behind a network that wasn't allowing me to do nuget (probably I didn't set the proxy).
But yeah, it worked!!
Wow, dotnet core is so cool. I am programming using VB.net in Visual Studios on my windows computer and running my code on my mac. So cool...
Most helpful comment
Wow, dotnet core is so cool. I am programming using VB.net in Visual Studios on my windows computer and running my code on my mac. So cool...