• Advertisement
Sign in to follow this  

Why can't I acess a process?

This topic is 1906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As you can see in my code I included System.Diagnostics. The purpose of this program is to get the current process and output it to the console. I am trying to access Process.GetCurrentProcess    on line 14  .  Also, as you can see, I can only access Process.Program   . Why is it that I can't use:

 

Process.GetCurrentProcess(); and all of the other functions of the Process Class.

 

 

 

166nq81.jpg

Share this post


Link to post
Share on other sites
Advertisement
Because your program's namespace is also called "Process", you'll need to use "System.Diagnostics.Process" to resolve the diambiguity between System.Diagnostics.Process and Process.

TL;DR: Don't name your program "Process".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement