Is System.Runtime.Serialization.FormatterServices available in metro style apps? RRS feed

  • Question

  • Hi,

    mainly I am interested in System.Runtime.Serialization.FormatterServices.GetUninitializedObject function? 

    In my application, I am performing following steps:

    * Create uninitialized object by calling System.Runtime.Serialization.FormatterServices.GetUninitializedObject from C++

    * Read some data from specific file in C++, and fill the data to my newly created object using Marshalling.

    * Execute default constructor through reflection.

    I couldn't found this class or function in .Net for Metro apps, but I was able to get System.Runtime.Serialization.FormatterServices through reflection while running my Metro app, and I am not totally sure what's going on? Is the class somehow hidden, or am I using this class from non-metro mscorlib.dll ?

    In any case, if I am wrong by using System.Runtime.Serialization.FormatterServices, can you suggest a different method how can I create unintialized object.

    P.S Activator.CreateInstance is no good, because 1, 3 steps will perform before 2nd step which is bad for me.


    Wednesday, May 16, 2012 1:27 PM

All replies




    The C++ in metro is different from the native C++. The data in C++ wrapped with WinRT, will have more convenient way to communicate with other language like C# or JavaScript.


    Please check this document

    Creating Windows Runtime Components in C++



    Best regards,


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 17, 2012 6:59 AM
  • Hi, 

    I was a bit unclear, actually I am using a WinRT component, but it's written in C#, I am using it from my main executable written in C++, and I was wondering is  System.Runtime.Serialization.FormatterServices stripped from .Net for Metro or not?


    Friday, May 18, 2012 7:52 PM
  • This forum is for discussion of the publically available Windows 8 Consumer Preview (build 8250) only. If you have access to newer builds under NDA then please address any questions through the channel from which you received the build.

    Saturday, May 19, 2012 7:21 AM
  • You could use Google's protobuf, wich is available in a variety of languages.


    Monday, May 21, 2012 3:56 PM