Click here to Skip to main content
13,097,012 members (69,439 online)
Rate this:
Please Sign up or sign in to vote.
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 25-Apr-10 17:01pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 26 Apr 2010
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100