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

Use namespace WinRTLegacy

Discussion in 'Windows' started by theSoenke, Nov 10, 2014.

  1. theSoenke

    theSoenke

    Joined:
    Dec 4, 2012
    Posts:
    106
    How do i use the WinRTLegacy namespace? By default it doesn't exist in Unity. There are 3WinRTLegacy.dll files in the Unity folder, but which one should i use?
     
  2. TongMing

    TongMing

    Joined:
    Oct 21, 2014
    Posts:
    31
    Did you do the "Switch Platform"?
    Then using WinRTLegacy within #NETFX_CORE
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,491
    Hi,

    it depends on what you mean by "using WinRTLegacy". If you want to access XML namespaces in Windows Store Apps, you have to wrap it in #if NETFX_CORE/#endif. If you're talking about other classes, like collections (ArrayList is a good example), just use them like you normally would in your code, and Unity will make sure that your scripts are taking the ArrayList from WinRTLegacy.dll.
     
  4. theSoenke

    theSoenke

    Joined:
    Dec 4, 2012
    Posts:
    106
    But when i try to use WinRTLegacy.IO.StreamReader i get an error that the namespace IO is not available in WinRTLegacy
     
  5. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,627
    This one has been added in Unity 5.0 (currently beta). It's not available in earlier releases.
     
  6. theSoenke

    theSoenke

    Joined:
    Dec 4, 2012
    Posts:
    106
  7. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    +1 on the documentation being confusing as it doesn't mention requiring 5.0.

    Is there a solution for 4.x?
     
    TooManySugar likes this.