I am trying to use Process.Start
in an ASP.NET Beta8 project that I would like to be able to run on Linux using .Net core. Visual studio is giving me an error at compile time:
Error CS0103 The name 'Process' does not exist in the current context
Going back and hovering my mouse over Process.Start
I can see a message that says "DNX core 5.0 not available". Is there a different way of invoking processes in asp.net 5? Or perhaps this isn't possible yet?
Here is exactly how I am using it:
var p = Process.Start("someprog", "someargs");
p.WaitForExit();
So it was me not really not knowing how the new project system works for .net. I needed to add a dependency to my project.json:
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Diagnostics.Process": "4.1.0-beta-23409"
}
}
},
Adding this made it compile. Although I am not sure if that version number is correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With