Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET3.0
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 18: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)

Advertise | Privacy | Mobile
Web02 | 2.8.150224.1 | Last Updated 26 Apr 2010
Copyright © CodeProject, 1999-2015
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