Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Gotta run it as admin.
You can also request elevated privileges for you program in one of the config files I forget how, but Google it. -
https://stackoverflow.com/questions
/15393288/how-do-i-make-a-console-app-always-run-as-an-administrator -
@delegate212
VS runs as admin,
app.manifest is modified
Error still occurs. Thanks for your input though. -
Works on my machine. You must be the worst developer in the world. THE WORLD!!
- signed: the first few responses on StackOverflow
Seriously, that's weird. Your networking/devops department push an unnecessary security update?
Dealing with that right now. VS isn't playing well with others (and it is running as admin).
I'm trusted with accessing million $$ systems, access to credit card tokens, customer data, etc, but try to debug a WebAPI project? Oh no, can't allow VS to run IIS Express, that's a security risk. -
@PaperTrail i'm working on my own computer at home so IT department setting up something weird isnt a problem.
It's a 64bit Win10 if that helps. -
@delegate212 jup. WUDFHost. Dont know what that is. (Seems to be something driver related from Windows)
-
@KittyMeowstika
Just handle the exception. In reality you cannot expect all users to have total permission over all processes anyway. I'd also exclude system processes too.
System.Diagnostics.Process.GetProcesses()
.Where(e => e.ProcessName != "Idle" && e.ProcessName != "System");
foreach (System.Diagnostics.Process proc in processes)
{
try
{
Console.WriteLine($"Process: {proc.ProcessName} ID: {proc.Id} CPU Time: {proc.TotalProcessorTime}");
}
catch (System.ComponentModel.Win32Exception ex)
{
//log exception
}
} -
@delegate212 thank you! I'm gonna try that.
The only user that's going to use that is my husband. He gave me this neat little programming task to keep me busy while I'm recovering from cancer/ chemotherapy. -
@delegate212 doesn't quite work. there seems to be a cast missing. what do i need to change?
-
@KittyMeowstika
Assuming its
System.Diagnostics.Process.GetProcesses()
.Where(e => e.ProcessName != "Idle" && e.ProcessName != "System");
Then store it as ienumerable<Process> -
Found the reason guys. It's the fucking Idle process. God knows why but apparently admin privileges aren't sufficient enough to get certain information from that process (other than id which is 0). God i hate microsoft.
-
retnikt67745y@delegate212 just as a sidenote, checking the process name like that could open you up to confusing bugs or security holes. Admittedly probably not in your case though.
-
@KittyMeowstika
> keep me busy while I'm recovering from cancer/ chemotherapy.
I'm happy you're busy and keeping focused on life outside of cancer.
I'm also very sorry you are having to go thru that battle. Cancer sucks. -
@PaperTrail thank you. It has been/ still is a hard time. But I'm on the best way to a full recovery. Hopefully I'm able to work again (at least a bit) by January.
Related Rants
Good afternoon guys. Long time no hear from me and I'm sorry about that. Had a lot health problems to fight.
I'm currently trying to list all processes that are running on my pc with a C# program. VS is running with admin rights but I'm still getting an error: "System.ComponentModel.Win32Exception: Access denied Error"
I tried googling it but if found the answer I didn't understand it.
Please help me.
question
c#
help me
visual studio