Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

XAML Apps fail with 'SetSwapChain failed' on 8.1/VS2013

Discussion in 'Windows' started by Mervill, Oct 21, 2013.

  1. Mervill

    Mervill

    Joined:
    Jul 20, 2012
    Posts:
    16
    Creating a simple project (three spinning cubes) and exporting it as either a C# or C++ XAML app compiles fine in VS2013 (after fixing broken references) but after displaying the Unity logo the app hangs indefinitely on a black screen.

    The only data that makes it into the log file is:
    Code (csharp):
    1. Module information:
    2.     Built with Compiler Ver '170050727'
    3.     Built from '' branch
    4.     Version is '4.2.1f4 (4d30acc925c2)'
    5.     Release build
    6.     Application type 'XAML'
    7.     GfxDevice: creating device client; threaded=1
    8. Direct3D:
    9.     Version:  Direct3D 11.0 [level 11.0]
    10.     Renderer: Intel(R) HD Graphics 4000 (ID=0x166)
    11.     Vendor:   Intel
    12.     VRAM:     128 MB
    13. SetSwapChain failed with error 0x8001010e
    14.  
    15. (Filename:  Line: 191)
    D3D11 C# apps run fine after you fix the missing reference, I haven't tried it with D3D11 C++ but I assume it works.

    I need a XAML project so I can implement the settings charm and making the app native to 8.1 is a requirement of our publisher.

    Project is attached. The build folder marked with _C is the C++ version and the one without is the C# version.

    Any help much appreciated!
     

    Attached Files:

  2. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    I'm not finding any of the visual studio related project files in your zip... it only contains the basic Unity project package.

    You will need to provide your app.xaml.cs and/or the mainpage.xaml.cs for us to see what could be causing the error...
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,948
    Hi,

    I doubt you will fix this error. It's related to new Windows 8.1 APIs and it's only fixed in 4.3, your project needs to target Windows 8.0, that way that error won't show up and I guess you've retargeted your project to Windows 8.1 ?

    Cheers
     
  4. Mervill

    Mervill

    Joined:
    Jul 20, 2012
    Posts:
    16
    Yes I did retarget the app, our publisher requires us to target 8.1 natively. I also need implement the settings charm and apparently the API is different between versions?

    Here is the C# XAML project (minus the players folder). I couldn't get the C++ version under the upload limit, all I did for it was re-target the app after it built, it didn't need any references changed.
     

    Attached Files:

  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,948
    When you did the retargeting, you explicitly use a newer Windows SDK (a.k.a Windows SDK 8.1) API which has additional requirements on how to set SwapChain, this isn't handled in 4.2.

    So your only solution currently is don't do the retargeting, and by that use old Windows SDK (a.k.a Windows SDK 8.0)