So, I'm going to jump straight.
I use Windows.Data.Json
to convert and use some JSON from a web service. I know about Newtonsoft.Json.Net
, and some others, etc., And yes, I specifically try to use Windows.Data.Json
for companies and causes of addiction.
The application has 3 main parts / components.
- UWP Win 10 Application - Main Application
- MVC Web Project - Web Services for the Application
- Portable class library - for common classes between both
The problem is that when I use JsonObject
MVC in a web project or in PCL, I get an error:
The type "IStringable" is defined in an assembly that is not referenced. You must add a reference to the assembly "Windows.Foundation.FoundationContract, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = null, ContentType = WindowsRuntime".
This error appears wherever I use JsonObject, but NOT in the UWP application project.
eg.
var apiJsonObj = JsonObject.Parse(jsonString);
and
cc.Type = apiJsonObj["TYPE"].ToString();
I searched the Internet and did not find anything useful in Windows.Data.Json
, and not IStringable
, except for this:
https://docs.microsoft.com/en-us/uwp/api/windows.foundation.istringable
My project does not have the Windows.Foundation.FoundationContract file specified in the Add Links dialog box, and I cannot find any links to it in the UWP application that I use, and no other information that was used.
UWP - MVC JsonObject
. UWP . - MVC .
, - Windows.Data.Json
, , , ?
, , Json.Net ..