Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cannot resolve Assembly or Windows Metadata file 'Windows.Foundation.UniversalApiContract.winmd'

Discussion in 'Windows' started by Blackshamrocker, Aug 10, 2018.

  1. Blackshamrocker

    Blackshamrocker

    Joined:
    Nov 2, 2016
    Posts:
    8
    Hi -

    I'm trying to make a build to the universal windows platform following the instructions here and here, and I've gotten as far as creating the solution. When I try to build the solution, however, it fails with the error in the title. I've found one other thread which mentions a similar issue from 2014, but either the fix is not applicable or I don't quite understand it.

    My Unity version is 5.5.6f1. When I navigate to 'C:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract' I find only a folder named 3.0.0.0. 1.0.0.0 is conspicuously missing.

    I would appreciate any help you can give me.

    Attached is the final visual studio output.

    Code (CSharp):
    1. 1>------ Build started: Project: Il2CppOutputProject, Configuration: Debug x64 ------
    2. 1>  Building GameAssembly.dll with MsvcWinRtToolChain.
    3. 1>      Output directory: D:\company\TestBuilds\build\bin\x64\Debug
    4. 1>      Cache directory: D:\company\TestBuilds\build\obj\il2cppOutputProject\x64\Debug
    5. 1>  ObjectFiles: 610 of which compiled: 0
    6. 1>  Total compilation time: 488 milliseconds.
    7. 1>  Building MapFileParser.exe with MsvcDesktopToolChain.
    8. 1>      Output directory: D:\company\TestBuilds\build\obj\il2cppOutputProject\x64\Debug\MapFileParserCache\build
    9. 1>      Cache directory: D:\company\TestBuilds\build\obj\il2cppOutputProject\x64\Debug\MapFileParserCache
    10. 1>  ObjectFiles: 16 of which compiled: 0
    11. 1>  Total compilation time: 3 milliseconds.
    12. 1>  Cleaned up 0 object files.
    13. 1>  Encoding map file using command: D:\company\TestBuilds\build\obj\il2cppOutputProject\x64\Debug\MapFileParserCache\build\MapFileParser.exe -format=MSVC "D:\company\TestBuilds\build\bin\x64\Debug\GameAssembly.map" "D:\company\TestBuilds\build\bin\x64\Debug\SymbolMap"
    14. 1>  Cleaned up 1 object files.
    15. 2>------ Build started: Project: game, Configuration: Debug x64 ------
    16. 2>D:\company\TestBuilds\game\game.vcxproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'Windows.Foundation.UniversalApiContract.winmd'
    17. 2>C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(264,5): Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime.
    18. ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    19. ========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
    20.  
     
  2. Blackshamrocker

    Blackshamrocker

    Joined:
    Nov 2, 2016
    Posts:
    8
    Update -

    I went looking and found the 1.0.0.0 version. I was able to add it by going to add or remove programs -> modify on visual studio and installing the version 10.0.10240.0 of the UWP SDK.

    However, when I add this reference, I'm still getting the same issue. The icon on the references has a warning icon:

     
  3. Blackshamrocker

    Blackshamrocker

    Joined:
    Nov 2, 2016
    Posts:
    8
    Hi again.

    I was able to get it working by ensuring the UWP SDK was also set to 10240.

     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    That sounds like something was wrong with the Windows SDK installation you were targeting.