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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Error building for UWP / Windows 10 Store

Discussion in 'Windows' started by kshitijgandhi, Dec 1, 2015.

  1. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    I recently updated to Unity 5.2.3f1 due to some bugs that were resolved in the new versions.

    But I started getting the following error in the Visual Studio Project -

    Code (CSharp):
    1. Expected Windows.Foundation.Metadata.ActivatableAttribute to exist. Check that Windows.winmd is referenced by your build system.    
    So I checked if any Patch releases were available. I tried 5.2.3p1.
    Visual Studio stopped giving build errors but the game crashes before the splash screen is shown or any info in the debug log is shown.

    Only the following log is shown -

    Code (CSharp):
    1. 'My App' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.1.0_1.0.23302.0_x86__8wekyb3d8bbwe\mscorlib.ni.dll'. Cannot find or open the PDB file.
    2. 'My App' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Code\My App 3D Win10 14\My App\bin\x86\Debug\AppX\entrypoint\My App'. Symbols loaded.
    3. 'My App' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Code\My App 3D Win10 14\My App\bin\x86\Debug\AppX\System.Runtime.dll'. Symbols loaded.
    4. 'My App' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Code\My App 3D Win10 14\My App\bin\x86\Debug\AppX\WinMetadata\Windows.winmd'. Module was built without symbols.
    5. 'My App' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Code\My App 3D Win10 14\My App\bin\x86\Debug\AppX\System.Runtime.WindowsRuntime.dll'. Symbols loaded.
    6. Exception thrown: 'System.Exception' in System.Runtime.WindowsRuntime.dll
    7. Exception thrown: 'System.TypeLoadException' in System.Runtime.WindowsRuntime.dll
    8. The program '[8572] My App' has exited with code 0 (0x0).
    9. Activation of the Windows Store app 'MyApp!App' failed with error 'The app didn't start'.
    The game used to compile and run without errors until the updates, but I had to manually copy some dlls etc. for it to work. I don't understand the problem exactly. All help is appreciated.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Did you update your Windows SDK recently by any chance? Several people have already reported issues for the SDK that got released yesterday.

    Either case, in Visual Studio go to Debug -> Exceptions, check the boxes right of "Common Language Runtime Exceptions", press OK, run your project. It should break when the exception is thrown, and you should be able to see the callstack.
     
  3. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    I tried what you said but to no avail.
    There is no output in the debug log besides the one I already mentioned above.
    Its probably not a bug in my code.
    There should be Unity's logs which show the device's properties for eg. the graphics card properties in my system, the logs where it states Splash Screen is loading etc.
    None of those logs are showing up.

    And the Exception details are not helpful. They are as follows, and they are the same as they were before I checked the boxes of "Common Language Runtime Exceptions" -

    Code (CSharp):
    1. System.Exception was unhandled
    2. Message: An unhandled exception of type 'System.Exception' occurred in Unknown Module.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    They wouldn't change, but you now should be able to inspect the callstack of where they get thrown.
     
  5. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    OK, so I got one step further into the details of the exception. It now shows the following log -

    Code (CSharp):
    1. System.TypeLoadException occurred
    2. Message: Exception thrown: 'System.TypeLoadException' in System.Runtime.WindowsRuntime.dll
    3. Additional information: Could not find Windows Runtime type 'Windows.ApplicationModel.Resources.Core.ResourceContext'.
    Is it not able to load a certain dll???

    Update :-
    I downgraded to Unity version 5.2.1p2 again, and according to the following thread mark a plugin as "Don't Process"

    http://forum.unity3d.com/threads/co...ndows-foundation-universalapicontract.368152/
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    When this exception fires, look at the callstack window. It should tell you where it is happening.
     
  7. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    Please have a look at the attached image for the call stack.
    The exception is occuring in external code, not in the game's code.
     

    Attached Files:

  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,507
    Alright, this is weird. Could you try building a totally empty project to see whether the problem goes away?

    What windows version are you on?
     
  9. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    Yes its occuring in an empty project also.

    Please check this thread once, I made changes to Windows.winmd file in th eWindows Kits before and might have undone those changes also -

    http://forum.unity3d.com/threads/wi...ersalapicontract-and-windows-conflict.357786/

    It seems to me that this might be causing problems. Also, in that case which version of Unity should I use and what winmd file should be there?? the original or the changed one as stated in the other thread?
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,673
    If you're using Unity 5.2.3f1 or later, you should revert any changes done to Windows.winmd stuff
     
  11. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    Thank You!
    That solved it.