Click here to Skip to main content
15,886,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Member 'System.Diagnostics.Process.Start(string, string)' cannot be accessed with an instance reference; qualify it with a type name instead

this error in the following code in line 4.


line 1 System.Diagnostics.Process obj = new System.Diagnostics.Process();
line 2 obj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
line 3 obj.WaitForExit();
line 4 obj.Start("C:\\Project\\emgscan.exe", sorce.FullName);
Posted

1 solution

Like the error message says: The start method can not be called for a specific instance of a Process object. Call it like a static method:

System.Diagnostics.Process.Start( params );


If you need more control over the started process, use the overloaded method which takes a ProcessStartInfo object as input, rather than just the string filename. Hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900