Reputation: 6016
I'm trying to build a Windows Universal App (UWP). I've downloaded the community edition of Visual Studio and started a blank app.
One of the things I want to do is to use the process class to get information about a certain process that is running.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace MyApp
{
class MyClass
{
public MyClass()
{
var MyProcess = System.Diagnostics.Process.GetProcesses().FirstOrDefault(f => f.ProcessName == "MyProcess");
}
}
}
However this doesn't work. The project won't build because it can't find the process class. Does anyone know what's I'm doing wrong? Do I need to included a reference to that class?
Upvotes: 0
Views: 1979
Reputation: 2361
You don't have access to other processes.
UWP applications (and their predecessors WinRT applications) pretty much run in a sandbox. For the sake of system stability they usually don't have access to each other. OEM and carriers have access to capability declarations in some cases that allow deeper access into the system but the general application developer does not.
Upvotes: 5