2

I built a UWP App in Visual Studio 2017 and also added a class library in the solution to run ML.NET but every time I run the application I get an exception

PlatformNotSupportedException. Retrieving information about local processes is not supported on this platform

What could be the problem?

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
Josh
  • 107
  • 6
  • Possible dupe of: https://stackoverflow.com/questions/50161323/calling-process-getprocesses-inside-a-net-standard-library-from-a-uwp-app – RyanNerd Jun 13 '18 at 06:02
  • I'm not sure if ML.NET is supported on the UWP platform, but I can't find any source that says so... – Jon Jun 13 '18 at 11:12
  • 1
    This *is* the kind of mishap that you need to expect in a 0.2 open source release. Download source from github so you can fix it. Should be easy, this code appears only in debugging code so all you have to do is comment it out. If you make it pretty then be sure to submit your changes back to the project. – Hans Passant Jun 13 '18 at 12:51

4 Answers4

4

This is a .NET Standard exception that happens when the a library tries to access an API which is not actually implemented on the platform but is present to make the platform .NET Standard compliant. In this case it seems ML.NET is trying to get process information which is not implemented in UWP yet so it fails with the given exception.

I would suggest filing this as an issue in the ML.NET GitHub issues to get first-party advice on if there is a workaround or to inform the team that developers need this to be able to use the library in UWP.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
3

I figured out how to solve my problem. I decided to first train the model on a .NET Core console app the export the trained model in my UWP app. It worked perfectly. Thanks to this post

Josh
  • 107
  • 6
1

ML.NET only supports x64 projects at this time. Is your project an x86 project by any chance?

Markus Weimer
  • 61
  • 1
  • 1
  • 4
  • Both the class library and the UWP app target x64 and it stills throws the same exception – Josh Jun 13 '18 at 10:26
1

ML.Net 0.7 now supports both x86 and x64 platforms... not ARM support yet.

https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcing-ml-net-0-7-machine-learning-net/

MrCSharp
  • 1,143
  • 17
  • 28