Search Unity

Tips and Tricks for Building for UWP and deploying to Xbox One

Discussion in 'Windows' started by schmosef, Apr 1, 2016.

  1. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Update #1: Info on the new Xbox Dev Mode Companion (preview) app

    -------------------------------------------

    We've been having some fun talking about the new ability to deploy a UWP app to Xbox One in the General Discussion forum.

    @TheLorax asked for some help with the deployment steps so I'm starting this thread in what I believe is the appropriate support forum so I can provide some assistance.

    I hope this post is useful. I will try to update it as the deploy process changes.

    If something is unclear, or you have a follow-up question, please let me know.

    First, the preliminaries. You will need:
    • A Dev PC running the latest build of (and updates for) Windows 10.
    • Visual Studio 2015 Update 2 with the latest version of the UWP SDK.
    • A Windows Dev Center Account. This is now a one time charge of approximately $19 USD. The price and terms may vary in your region. (Thanks @Steve Tack)
    • An Xbox One.
    • Officially, the Xbox One and Dev PC need to be on a wired network. Unofficially, I did a test and was able to successfully deploy an app via WiFi. YMMV.
    • Install and run the "Dev Mode Activation" app on your Xbox One via the App Store.
      screenshot of Xbox One app store.gif
      You will get an activation code that you need to enter in your Dev Center Account Portal.
      Dev Center Portal.gif
      Once the code has been accepted, you exit the Dev Mode Activation app on your Xbox One and it will automatically start downloading and installing the "Insider" build of the Xbox One OS. When finished it will reboot into "Dev" mode.
    • After the Xbox One reboots, you will be prompted to sign into Xbox Live. Then, enter the "Dev Home" app you will see on the right side of the Home screen.
      the dev mode home screen.jpg the dev home app.gif
    • I'm not sure what minimum version of Unity is needed. I've done all my testing with Unity 5.3.4p1.
    • When you install Unity, you need to include the "Windows Store .NET Scripting Backend" component. (Thanks @tapticc)
    • The Known issues with UWP on Xbox One developer preview and System resources for UWP apps and games on Xbox One pages are both worth reading.
    • A note for those who have an actual XBox One Dev Kit (instead of a retail unit), you do not have to have the XDK installed on your PC to deploy UWP to your dev kit, but if you do, make sure it is the latest version. Older versions of the XDK have known deployment issues, especially with the il2cpp scripting backend. (Thanks @Snowed-In)
    Ok, here's how you build for UWP and deploy to Xbox One:

    1. Create a project in Unity. Start with something simple. For the purposes of this write up I imported the free Particle Callbacks demo (via the asset store) into an empty project. I had to make a few, very minor, code tweaks to get it to run in Unity 5. Use one of the updated Unity 5.x demo assets if you want something that will work without tweaking. Or just create a simple "Hello World" type project. I also imported the Advanced FPS Counter asset because I like the device and memory status info it displays. Don't worry if you don't own this asset, it's not required for a successful build. Note that the file path of your Unity project cannot have an ampersand. You will not be able to open your UWP project successfully if your Unity project has an ampersand in the file path. (Thanks @tapticc)

    2. In Unity, go to File>Build Settings.
      Unity Build Settings Screen.gif
    (continued below so I can post more pictures)
     
    Last edited: Oct 22, 2016
  2. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    3. Select "Windows Store" in the "Platform" section. Click "Switch Platform", wait for it to finish processing, then click "Player Settings..."

    4. In the "Publishing Settings" group, make sure you have a certificate specified. If not, click the "Create..." button to make one.
    Player Publish Settings.gif

    5. Back to the Build Settings. Choose "Universal 10". The other settings are documented elsewhere, you can use the settings in my screenshot (in the above post) to test the deploy process, then go back and research them to better understand your needs.

    6. Once you have the settings configured, click the "Build" button. You will be asked to select a folder. Once you do, the build will start and a Visual Studio Solution will be created in the indicated path. Note that the file path where your save your Build cannot have an ampersand. You will not be able to open your Build in Visual Studio if you have an ampersand in the file path of where you save your Build. (Thanks @tapticc)

    7. Start Visual Studio 2015 Update 2 and drag the .sln file over it to open the Solution (Or use "File>Open Project/Solution").
    A completed UWP Build.gif

    8. You will probably see a bunch of warnings and maybe a few errors after you first open the Solution. You can ignore them for now.
    Warnings when you first open the Solution.gif

    9. (Optional) I like to do a test local deployment first. On the Standard toolbar, change the target to "Local Machine", the configuration to "Master" and the platform to x64.
    configuration for local test.gif

    10. (Important) Whenever you change the build settings, you need to "clean" the Solution. Select "Build>Clean Solution" or right click the Solution in "Solution Explorer" and select "Clean Solution".
    cleaning the solution after changing the build settings.gif
    (continued below so I can post more pictures)
     
    Last edited: Apr 4, 2016
  3. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    11. If you do not clean the solution you will most likely get errors when you compile.
    compile error from not cleaning the solution.gif

    12. Use CTRL+F5 to start the project without debugging. The compile will take a few moments, You will see errors and warnings change as each project in the Solution compiles. If everything works correctly, you will see the game running in a Window.
    The UWP App running locally.jpg

    13. Close the running game.

    14. Change the build target to "Remote Machine". You will be asked to specify a remote connection. I use the IP address that my router assigned to my Xbox One but you can probably enter "XboxOne" for the address, which is the default hostname set in the Dev Home app on your Xbox One. If you have more than one Xbox One, you should change the hostname for one of them.
    remote connection properties.gif

    15. Clean the solution again!

    16. Use CTRL+F5 to rebuild and deploy the project without debugging. The compile stage will take a few moments. As it starts the deploy stage, if this is the first time you are deploying a UWP app to this Xbox One, you will be asked for a PIN code. On the Xbox One, in the Dev Home app, select "Pair with Visual Studio" to generate a PIN. Enter the PIN in Visual Studio. It took a few tries for me to get this right. Either I was mistyping the PIN or it was timing out. It worked after about 4 tries. You will only have to do this once.

    (Sorry, I don't have screenshots for this. It was a pain and I don't want to redo it.)

    17. Once your Visual Studio installation is paired with your Xbox One, the app will continue to deploy (actually, sometimes you will have to start the process again but it will not ask to pair again). When finished deploying your app will automatically start running.
    your UWP app running on an Xbox One.jpg

    18. That's it. Enjoy!​
    (continued so I can post more pictures)
     
    Last edited: Apr 1, 2016
    MrEsquire, Pendrokar, XCO and 2 others like this.
  4. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Notes:

    • Use the Dev Home app to "Leave Developer Mode" so you can access your retail games and apps.
      leave developer mode.gif

    • Use the Dev Mode Activate app to reboot into Dev Mode or Deactivate Dev Mode. Be careful, deactivating Dev Mode will probably cause your Xbox One to factory reset.
      reboot into dev mode.jpg

    • When your app launches, you will see three splash screens: 1) small rectangle; 2) large rectangle; 3) Unity splash screen.
      combined splash screens.jpg

    • Sometimes, the Unity splash screen has some artifacts.
      unity splash artifacts.gif

    • When you exit Dev mode, it will clear your deployed apps. You will have to redeploy them if you want to run them again the next time you enter Dev mode. Rebooting Dev Mode without exiting will not clear your deployed apps.

    Troubleshooting:

    • When in doubt, clean your solution.
    • There is a known bug in the Dev Home app that will cause it to not show a correct list of your deployed apps. You can see and re-launch your deployed apps via the "My Stuff" app in the "Apps" section. Sometimes, your apps won't launch. Try again. They will eventually.
      the My Stuff app showing your deployed UWP apps.gif
    • I ran into an issue where none of my apps would successfully deploy. The deploy would always fail at the final step where it registers the app on the remote device. The Known Issue page (linked above, in the first post) suggests exiting Dev Mode, then rebooting into Dev Mode. This worked for me and allowed me to deploy apps again.
    • @stownend figured out an alternate deployment technique that seems to work around issues that some people have with deploying projects to their XboxOne. You can find his solution here.
     
    Last edited: Feb 28, 2017
    XCO likes this.
  5. mossyblog

    mossyblog

    Joined:
    Jun 29, 2013
    Posts:
    24
    OR...

    Create the Unity3D targeting Windows directly, use the win32 converter and you're back to UWP ?
     
  6. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I think that converter is for targetting Windows PCs. I don't think it will work for deployments to Xbox One.
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    The resulting app after the conversion will only work on desktop. The converter doesn't magically make the program not call the APIs that are available on desktop only - it merely packages it up into an appx.

    @schmosef: nice guide! Regarding the advice on cleaning solution: that shouldn't be needed - I don't ever do it. What kind of issues do you run into without cleaning it?
     
  8. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I get strange compile errors. It's easy to reproduce. It happens every time I switch build settings. I switch build settings a lot because i have ARM based tablets and a phone, and remote touch screen PCs that I use for testing. The screenshot above shows an error that says multiple inheritance is not supported. It's not always the same error. If i clean the solution, the compile error goes away. Maye this is a bug I should submit for review?
     
    Last edited: Apr 1, 2016
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Yes please. I'd definitely consider it a bug. Include all the steps you do to build, which settings you change, etc - we'll need it to be as detailed as possible to be able to reproduce it.
     
  10. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Ok, tomorrow I'll write it up nicely and submit the Particle Callback demo project I used for the above guide. After I compiled and deployed locally in step 12, I could not compile and deploy remotely to the Xbox One without first cleaning the Solution in step 15.
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
  12. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    @schmosef thanks for taking the time to document this, appreciated :)
     
    XCO and schmosef like this.
  13. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Just a quick tip if you get a message about WIndows Module Not Loaded or similar, I had to reinstall using the Windows Store .NET Scripting Backend ticked manually as this was not selected by default:

     
    angrypenguin and schmosef like this.
  14. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    I have installed Visual Studio 2015 Release 2 and can create a new app on my Xbox following these instructions:
    https://msdn.microsoft.com/windows/uwp/xbox-apps/getting-started
    However when I open the Unity build project in Visual Studio, the project isn't a Universal Windows project and the Project Properties window won't appear to set it to remote (and no remote option on the Standard Toolbar)

    Did you encounter this? No doubt I have missed something during setup, but the fact that a new Universal Windows solution in Visual Studio shows me the options makes me think I have installed all the pre-requisites

    thanks :)
     
  15. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Erm... oops I was opening the Unity solution file rather than the UWP Build solution file, both had the same name!
     
  16. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    This is a good point.

    Thanks for mentioning it.

    I've updated the "preliminaries" section in my first post with this info.
     
    tapticc likes this.
  17. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Did you have to install anything special to be able to build Master builds? I can build debug and release modes but get errors in Master mode.

    1> Assembly-CSharp-firstpass -> C:\Users\Craig\Desktop\Windows 10 UWP\UWP\Assembly-CSharp-firstpass\bin\x64\Master\Assembly-CSharp-firstpass.dll1>------ Build started: Project: Assembly-CSharp-firstpass, Configuration: Master x64 ------To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'Restoring NuGet packages...Failed to resolve all project references for 'Windows 10 UWP'. The package restore result for 'C:\Users\Craig\Desktop\Windows 10 UWP\Build\Windows 10 UWP\Windows 10 UWP.csproj' may be incomplete.

    ...
    ...
    ...


    ========== Deploy: 0 succeeded, 0 failed, 0 skipped ====================
    Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========3>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): error : Internal compiler error: Failed to parse 'UnityStandardAssets.Utility.DragRigidbody+<DragObject>d__8, Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'3> Compiling interop code3> Generating serialization code3> Computing application closure and generating interop code3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Invalid IL detected in method 'System.Int64 UnityEngine.Internal.$MethodUtility.$Invoke2347(System.Int64, System.Int64*)' at IL offset 0x12 referring to invalid Windows Runtime method 'System.Void Windows.System.UserWatcher.remove_Updated(Windows.Foundation.EventRegistrationToken)'.3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Invalid IL detected in method 'System.Int64 UnityEngine.Internal.$MethodUtility.$Invoke2346(System.Int64, System.Int64*)' at IL offset 0x12 referring to invalid Windows Runtime method 'System.Void Windows.System.UserWatcher.remove_Stopped(Windows.Foundation.EventRegistrationToken)'.3>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Invalid IL detected in method 'System.Int64 UnityEngine.Internal.$MethodUtility.$Invoke2345(System.Int64, System.Int64*)' at IL offset 0x12 referring to invalid Windows Runtime method 'System.Void Windows.System.UserWatcher.remove_Removed(Windows.Foundation.EventRegistrationToken)'.

    There are loads of these errors, I have tried unticking allow Nuget to check for missing packages during build and tried unchecking Unity C# Projects within the Unity Build screen with no luck.

    Any tips would be appreciated :)
     
  18. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I see that "package restore incomplete" error all the time. I think it's a red herring.

    Have you tried cleaning your Solution? It's item #10 in my steps above. That usually works for me when, all of a sudden, my Solution won't build.
     
  19. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Yeah been trying for few hours now, will keep trying and share if i figure it out
     
  20. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Sometimes "clean" doesn't work perfectly. Sometimes you have to manually delete the "obj" directory.

    Exit Visual Studio and use File Explorer to delete the obj directories.

    There are 3 obj folders, one for each project in the Solution.

    1) and 2) In the root of your Unity Project, there is a folder called "UWP". In there are two sub folders. Each sub folder will contain an obj folder. Delete them both.

    3) Wherever you created your Unity project Build for UWP, there will be a sub folder named after your Unity project. In there will be a obj folder. Delete it.

    Then reopen the Solution in Visual Studio, check your build settings and perform a "Rebuild Solution" from the Build menu.

    Hopefully, you'll get a clean build out of this and you can try to do a deploy.

    Note that your deploy might fail, even if the build is successful. This is a known issue when changing build settings. See the link for possible workarounds.
     
    tapticc likes this.
  21. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Thanks will try this in the morning!
     
  22. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    I think I'm getting further now

    ========== Build: 0 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========3>C:\Users\Craig\Desktop\Windows 10 UWP\Build\Windows 10 UWP\Windows 10 UWP.csproj(248,5): error MSB3030: Could not copy the file "C:\Users\Craig\Desktop\Windows 10 UWP\UWP\Assembly-CSharp\bin\x64\Master\Unprocessed\Assembly-CSharp.dll" because it was not found.3> Copying unprocessed assemblies...3> UnityProjectDir "C:\Users\Craig\Desktop\Windows 10 UWP".3> UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport".3> UnityInstallationDir "C:\Program Files\Unity\Editor".3>------ Build started: Project: Windows 10 UWP, Configuration: Master x64 ------2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): error MSB3270: There was a mismatch between the processor architecture of the project being built "AMD64" and the processor architecture of the reference "C:\Users\Craig\Desktop\Windows 10 UWP\UWP\Assembly-CSharp-firstpass\bin\x86\Master\Assembly-CSharp-firstpass.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.2>------ Build started: Project: Assembly-CSharp, Configuration: Master x64 ------To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'Restoring NuGet packages...1>Project not selected to build for this solution configuration 1>------ Skipped Build: Project: Assembly-CSharp-firstpass, Configuration: Master x86 ------

    No more IL errors at least!
     
  23. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    So I tried a clean solution before build solution and the IL errors returned, tried building Release rather than Master and that works no problem.

    After some more reading, the IL messages are warnings rather than errors, so just this issue to sort:



    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========1>C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : ILT0005: 'C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\Tools\nutc_driver.exe @"C:\Users\Craig\Desktop\Windows 10 UWP\Build\Windows 10 UWP\obj\x64\Master\ilc\intermediate\MDIL\Windows 10 UWP.rsp"' returned exit code 21>STARTPROCESSTASK : error : Internal compiler Error
     
    Last edited: Apr 4, 2016
  24. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    It's a one-time fee. From the FAQ:

    "Individual accounts cost approximately $19 USD, and company accounts cost approximately $99 USD (the exact amounts may vary depending on your country or region). This is a one-time registration fee and no renewal is required."
     
  25. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Thanks, I'll update the info above.

    They keep changing the pricing and terms for this account.

    I paid for my account back when Microsoft first launched the Surface RT.

    I paid around $100 for the year.

    Then a few weeks later they held a dev conference and dropped the price to $19.

    I'm pretty sure they automatically charged me for several renewals, but maybe they haven't done it in a while. I don't remember when I last saw a charge.
     
  26. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Sussed it! If you want to compile a Master build, you need to untick this setting:

     
  27. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    @tapticc is the master build issue happening only on this particular project? You need to have "Compile with .NET Native tool chain" checkbox checked in order to submit your game to the Windows Store, so that workaround isn't really valid. Which Unity version are you on?
     
    tapticc likes this.
  28. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Ahh poo! I'm using Unity 5.3.4f1, I tried to create a brand new project with a scene with a light, camera and plane. Originally the path name had a "&" character in it and it didn't open in visual studio properly, I moved it to a simpler name to resolve (this is a side issue of course).

    I then tried a Master build on the basic scene (Master, x64, Remote Machine) and it built successfully (Compile with .NET Native tool chain was ticked for confirmation). I tried next to run on the Remote Machine, this did fail but after I did a Clean Solution and then clicked on Remote Machine, it compiled and copied the basic scene to the Xbox and ran no problem. I did realise I should use Deploy rather than the run button to avoid the "Catastrophic Failure" message!

    This was done with Unity C# Projects ticked in Unity when I did the build, normally I have been leaving that unticked so I tried that next (after deleting the Build folder to ensure nothing was picked up inadvertently). This worked properly as well.

    I will start adding in components I was using in my other project and see where it breaks (was using Third Person Controller and Rewired assets for info)
     
  29. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    So I imported Third Person Controller but used my original scene and the Master build worked.

    I then imported Rewired and added the Rewired Input Manager to the basic scene. You have to switch to PC build and back to Windows 10 build to install some extra Rewired files in case you are following this. I built the Master build using the basic scene with Rewired Input Manager in the scene and got the original errors:

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : ILT0005: 'C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\Tools\nutc_driver.exe @"C:\Win UWP\Build\Win UWP\obj\x64\Master\ilc\intermediate\MDIL\Win UWP.rsp"' returned exit code 21>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : Method 'SharedManager.GetMethod(Type, string)' will always throw an exception due to the missing method 'Type.GetMethod(string, BindingFlags)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : Method 'SharedManager.GetProperty(Type, string)' will always throw an exception due to the missing method 'Type.GetProperty(string, BindingFlags)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : Method 'ReflectionExtensions.CreateDelegate(Type, MethodInfo, object)' will always throw an exception due to the missing method 'Delegate.CreateDelegate(Type, object, MethodInfo)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(1129,5): error : Method 'NetworkEventManager.OnServerAddPlayer(NetworkConnection, short)' will always throw an exception due to the missing method 'NetworkServer.get_connections()'. There may have been a missing assembly.1>STARTPROCESSTASK : error : Internal compiler Error1> Generating native code1>
    Cleaning up unreferenced code1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Method 'SharedManager.GetMethod(Type, string)' will always throw an exception due to the missing method 'Type.GetMethod(string, BindingFlags)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Method 'SharedManager.GetProperty(Type, string)' will always throw an exception due to the missing method 'Type.GetProperty(string, BindingFlags)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Method 'ReflectionExtensions.CreateDelegate(Type, MethodInfo, object)' will always throw an exception due to the missing method 'Delegate.CreateDelegate(Type, object, MethodInfo)'. There may have been a missing assembly.1>
    C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(887,5): warning : Method 'NetworkEventManager.OnServerAddPlayer(NetworkConnection, short)' will always throw an exception due to the missing method 'NetworkServer.get_connections()'. There may have been a missing assembly.1>
    Compiling interop code1>
    Generating serialization code1>
    Computing application closure and generating interop code
     
  30. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Thanks for helping by the way!
     
  31. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Can you submit a bug report with the project that's failing attached and post the case # that you'll get emailed with?
     
  32. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I debated whether to mention that issue when I was creating my guide and I decided to leave it out.

    I think I was just getting overwhelmed.

    I guess I should have included it. I've updated the guide to include it now.
     
  33. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    I've zipped the package and it is uploading now, but it's bed time so will confirm the case # tomorrow
     
  34. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    It's 785743
     
  35. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Thanks, we'll take a look.
     
    tapticc likes this.
  36. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    Thanks for taking the time to do this. Great job on the details that count. I'm sure you've saved us all hours of work!!
     
    schmosef likes this.
  37. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    We identified the issue and a fix is under way.
     
    Pendrokar, schmosef and tapticc like this.
  38. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Awesome thanks!
     
  39. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    @schmosef, thanks a bunch for sharing! Probably saving me a bunch of time toying around with this right now. :)
     
    schmosef and tapticc like this.
  40. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    @angrypenguin when you see your game on an Xbox One for the first time, it's so inspiring :)
     
    schmosef likes this.
  41. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I don't think I'll get my main game on there tonight, as I'm using a few 3rd party things that don't seem to be compatible. (The VS project gets created, but there's a bunch of errors in Unity and a .dll that the VS project needs to copy doesn't get created.)

    I'll have a quick crack at one of my side projects though...
     
    tapticc likes this.
  42. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Try IL2CPP!
     
  43. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    So, the network connection was a weak point. No joy at all with wireless, but I can't say they didn't warn us. Initial issues with a wired connection too, but eventually the IP address changed and then it suddenly all started working. Might not have been anything to do with the Xbox, of course.

    Interestingly, the debug build of my game doesn't work - it crashes at the large-box splash. Release mode seems good, though.

    My main project might need quite a bit of work removing 3rd party libraries that seem to use incompatible parts of .NET. The most notable one is RAIN. Fingers crossed I can get that working rather than having to replace it...
     
  44. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Oh? Will do...

    Edit: Need to come back to this later. I'll let you know when I do.
     
    Last edited: Apr 9, 2016
  45. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    What does IL2CPP do differently, excuse my ignorance!
     
  46. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    On Windows Store, we today support two scripting backends: .NET and IL2CPP. .NET has historically been the only one supported, but we introduced IL2CPP for Windows Store in 5.3.

    .NET scripting backend is unique in the way that it targets a totally different .NET profile (.NET Core 5), which lacks a lot of APIs that exists in the normal unity profile (.NET 3.5), but has some extras. Due to this, many plugins don't work on .NET scripting backend since they use APIs that are not available.

    IL2CPP scripting backend, on the other hand, supports the exact same .NET profile as every other Unity platform.
     
    tapticc likes this.
  47. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Thanks for the explanation :)
     
  48. rbarbosa

    rbarbosa

    Joined:
    Jun 20, 2012
    Posts:
    61
    This whole thing is really tough to endorse in its current state. App deployment is INCREDIBLY BROKEN.

    Last night, my app stopped deploying properly, failing at the registration stage as indicated by the OP. I took my Xbox out of developer mode and put it back into developer mode. Did a clean master build and deployed with no problem.

    Today, I did a clean debug build, which failed in the registration stage. So I attempted to uninstall the app to try to redeploy. Only, I can't load the "My Games & Apps" viewer in the XB1 because it fails with an error code. I'm guessing something in the debug deployment failed and left a corrupted package that the "My Games & Apps" viewer is unable to digest, causing it to fail to load.

    Okay, no worries, I'll just load the Dev Home app and try to remove the app from there or take my console out of dev mode and put it back in again. Only, Dev Home won't load anymore and crashes with no error message/code at all.

    Hmmm...maybe I'll remove it from the web portal. Nope. That's failing to uninstall as well.

    So...I'm stuck in dev mode and unable to remove my application from the console.

    I guess that means a "factory reset" of my console is in order.

    I'll update the post and let you all know how that goes.

    If you are so intrepid that you still want to try this for yourself, I'd highly recommend uninstalling from the "My Games & Apps" viewer EVERY TIME you want to update your build on the console. It may be the only thing that saves you from a corrupted deployment mucking up your whole works.

    Good luck! ;)

    Update 1: I will +1 Microsoft for recognizing that I had done a factory reset and not "charging" me for another dev mode console activation. My count was reset to 3 available activations after the factory reset took my console out of dev mode. The final dev mode update is happening now. We'll see if this goes well.

    Update 2: It just occurred to me that I did not try using the device management features from developer.microsoft.com to take my device out of developer mode. This MAY have saved me a factory reset. If you run into a problem like I did, you may want to give this a shot. Also, it might be beneficial for MS to allow us to download the Dev Mode Activation app (which includes a deactivation feature) from the developer mode Xbox Live sandbox app store. Once you switch to dev mode the app is no longer available (making its deactivation feature kind of pointless).

    Update 3: Being a glutton for punishment, I tried to rinse and repeat after I got my console back into dev mode. I started with a master build which deployed without problems. Then I switched the project to debug mode in Visual Studio. This time, I uninstalled the application on my console to avoid repeating my original problem. The application failed to deploy, but it didn't break my dev mode features. So I went into Visual Studio and changed the package version in the manifest from 1.0.0 to 1.0.1 and attempted to redeploy the debug build. This actually worked. This seems to suggest that some type of cache, whether memory resident or on disk, is taking note of certain properties of the application and failing when a redeploy doesn't align with what it already "knows" of the package. Not sure if this will result in gluts of unusable disk space (the application had already been uninstalled) or if this will eventually clean itself out, but changing the package version does seem to represent a clean slate for the deployment process. Hopefully that information will be of use to someone.
     
    Last edited: Apr 10, 2016
  49. rbarbosa

    rbarbosa

    Joined:
    Jun 20, 2012
    Posts:
    61
    Unrelated to my previous post regarding deployment problems, is anyone else noting really high resource utilization when their app is running.

    I have a default Unity project, to which I've added a sphere.

    I added a small script that detects when the A button is pressed and changes the color of the sphere from Color.red to Color.blue. Nothing fancy, I just wanted to test input functionality.

    When this app is running, it's got a working set of ~120MB and a commit size of over 180MB. With a limit of 448MB (at least until general availability), this seems pretty high for such a simple app.

    My hope is that most of that is from the engine and that adding additional assets, content, and code will represent incremental increases in resource utilization.

    Also, I'm using Direct3D instead of XAML. Not sure how/if that is influencing the resource utilization.

    Curious to hear about the experiences of others.

    Thanks!
     
  50. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    D3D is what you should be using if you don't need XAML. XAML is slower to startup and consumes more memory. Make sure you don't measure in debug build.

    What does the Unity profiler say?

    I haven't looked at the xbox memory consumption, but at least on desktop I know D3D11 drivers like to preallocate over 100 MB of memory.

    Lastly, you may try IL2CPP scripting backend - it might give you better memory usage (mileage may wary).