Skip to main content
1-Visitor
June 8, 2018
Solved

Managed API in UWP app

  • June 8, 2018
  • 1 reply
  • 1962 views

I am trying to convert a Windows Store App to a UWP. Since the Managed API (MKS.ManagedAPI.dll) seems to be based on .NET 4 and UWP is .NET Core, it's not completely straight forward. Is there a way to get the API to work with a UWP?

Best answer by nborrerojr.

This was painful but I have it working now. Here's what happened:

At this line:

MKS.ManagedAPI.IntegrationPoint.CreateSession(String sessionUser, String sessionPassword)

 

I was getting this exception:

System.TypeLoadException
 HResult=0x80131522
 Message=Could not load type 'System.Threading.ThreadPriority' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
 Source=MKS.ManagedAPI

 What fixed it was checking "Compile with .NET Native tool chain" in Build settings.

1 reply

nborrerojr.1-VisitorAuthorAnswer
1-Visitor
June 27, 2018

This was painful but I have it working now. Here's what happened:

At this line:

MKS.ManagedAPI.IntegrationPoint.CreateSession(String sessionUser, String sessionPassword)

 

I was getting this exception:

System.TypeLoadException
 HResult=0x80131522
 Message=Could not load type 'System.Threading.ThreadPriority' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
 Source=MKS.ManagedAPI

 What fixed it was checking "Compile with .NET Native tool chain" in Build settings.