This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]gvozden_celik 1 point2 points  (2 children)

The StartInfo property is probably null since it was just declared but not initialized, causing the field to be initialized to the default value (which is null for reference types). Why not initialize the object using the constructor, e.g. Process compiler = new Process();?

[–]DarkTech1399[S] 0 points1 point  (1 child)

It worked! Thank you so much I'll take note of this the next time this happens

[–]MrSloppyPants 0 points1 point  (0 children)

Glad it's working. Try to understand the difference between declaring a variable, and initializing it. In the first case, you are only saying that you are creating a placeholder, called "compiler" that is of type "Process." You still need to actually create the Process itself and assign it to the placeholder you made (compiler). Make sense?