Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Formatters does not exist in the namespace System.Runtime.Serialization

Discussion in 'Windows' started by sstrong, Sep 13, 2014.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,189
    When I run the project from Editor in Windows Store App mode, the code runs fine. However, if I attempt to build the project to C# XAML Universal 8.1, the compile fails with:

    The type or namespace name 'Formatters' does not exist in the namespace 'System.Runtime.Serialization' (are you missing an assembly reference?).

    Is there any way to get Formatters.Binary to work on Windows Store 8.1 and Windows Phone 8.1 without using Unity Serialization?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    .NET for WinRT has many things missing, including serialization. It's better to use Unity serialization.
     
  3. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    What is it exactly you're trying to accomplish @sstrong? My asset does accomplish it... depending on what you're doing you could pull the source code for the official Newtonsoft JSON .NET from GitHub and see how they accomplished it for WinRT and then adapt it to Unity.
     
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,189
    Is there any sample c# code to serialize a custom [Serializable] class with Unity serialization? Looking on the forums it seems like a pretty regular request.