I have a .NET standard library which is below:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace process_library
{
public class ProcessHandler
{
public ProcessHandler()
{
}
[MTAThread]
public Process[] GetProcesses()
{
return Process.GetProcesses();
}
}
}
I then have a Template10 project with all the .net core stuff updated to the latest version (required to get it to build) and referenced my library. This all works so far.
Inside my main view-model I instantiate my library class
ProcessHandler p = new ProcessHandler();
This is also successfull.
My problem is when I call my get process method it pukes and throws an error GenericParameterAttributes = '((System.RuntimeType)type).GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException'
Is there any way I can get this to work?
UPDATE Removed all the Template10 stuff as it tends to mask the real errors and tried a blank UWP app. Get this exception
System.PlatformNotSupportedException
HResult=0x80131539
Message=Retrieving information about local processes is not supported on this platform.
What is the point of including it in .net standard (Which is supposed to contain a standard set of apis you can use) if you cant even use it
I should also note I'm targeting the very latest update (Spring 2018)