Search Unity

Unable to build even an empty project.

Discussion in 'VR' started by rowanG, Aug 15, 2017.

  1. rowanG

    rowanG

    Joined:
    Jul 28, 2017
    Posts:
    4
    Recently I have installed unity and wanted to try out building something for the HoloLens. But after days of trying out things I can't even build an empty unity project for the HoloLens.

    The steps I am taking are:
    1. New unity project.
    2. Build for UWP->Hololens. This works.
    3. Open resulting solution in visual studio and try to build there.

    Then the build breaks when issuing the command "SerializationWeaver."

    With the following traceback:

    Code (CSharp):
    1. Restoring NuGet packages...
    2. 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.'
    3. 1>------ Build started: Project: Assembly-CSharp-firstpass, Configuration: Debug ARM ------
    4. 1>  Running SerializationWeaver...
    5. 1>  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
    6. 1>     at System.ThrowHelper.ThrowKeyNotFoundException()
    7. 1>     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    8. 1>     at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve()
    9. 1>     at Unity.NuGetAssemblyResolver..ctor(String projectLockFile)
    10. 1>     at usw.Weaver.ReaderParameters(String assemblyPath, ConversionOptions options)
    11. 1>     at usw.Weaver.Weave()
    12. 1>     at usw.Program.RunProgram(ConversionOptions options)
    13. 1>     at usw.Program.Main(String[] args)
    14. 1>C:\b\GeneratedProjects\UWP\Assembly-CSharp-firstpass\Assembly-CSharp-firstpass.csproj(192,5): error MSB3073: The command ""C:\b\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "C:\b\GeneratedProjects\UWP\Assembly-CSharp-firstpass\bin\ARM\Debug\Unprocessed\Assembly-CSharp-firstpass.dll" "-pdb" "-verbose" "-unity-engine=C:\b\HoloLensTestProject\Unprocessed\UnityEngine.dll" "C:\b\GeneratedProjects\UWP\Assembly-CSharp-firstpass\obj\ARM\Debug\ARM\Debug" "-lock=C:\b\GeneratedProjects\UWP\Assembly-CSharp-firstpass\project.lock.json" "@C:\b\GeneratedProjects\UWP\Assembly-CSharp-firstpass\SerializationWeaverArgs.txt" "-additionalAssemblyPath=C:\b\HoloLensTestProject\Unprocessed" "-unity-networking=C:\b\HoloLensTestProject\Unprocessed\UnityEngine.Networking.dll"" exited with code 1.
    15. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    I have tried the following running visual studio as administrator. Using a folder with no spaces as the build folder. Making the path as short as possible. I am at my wits end and I have no idea what the problem is...

    I am using unity 2017.1.0.f3 with visual studio community 2017.

    I have also I uninstalled unity 2017.1.0.f3 and installed the beta version unity 2017.2.0.b6 and I am having the exact same issue.
     
    Last edited: Aug 15, 2017
  2. rowanG

    rowanG

    Joined:
    Jul 28, 2017
    Posts:
    4
    Oke I seem to have found the problem. But I am unsure how to fix it.

    The key value comes from the SerializationWeaver trying to get the key "UAP,Version=v10.0" under the "targets" object in projects.lock.json file. In my projects.lock.json however this key is called "UAP,Version=v10.0.10240". Manually changing this key makes the build succeed.

    I figured it out by looking at this decompiled unity code on github: https://github.com/MattRix/UnityDec...r.Scripting.Compilers/NuGetPackageResolver.cs

    This property is governed by setting the "min version" in the project properties of visual studio. I have no idea what exactly is going wrong. I assume I have configured either unity wrong or am missing some kind of microsoft SDK package. The lowest min version I can select is 10.0.240
     
    Last edited: Aug 15, 2017
    naatura and thomas-masquart like this.
  3. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    45
    I ran into the same issue last night and between it and a few other quirks going on reformatted my hardrive and reinstalled windows.

    Looks like the issue is a problem with VS 2017 15.3
     
  4. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    45
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,025
    Yup, that's the same issue. Workarounds involve either using il2cpp scripting backend for now, or using VS2015 to build the project.
     
  6. rowanG

    rowanG

    Joined:
    Jul 28, 2017
    Posts:
    4
    Odd I didn't find that thread at all while googling :(. Good to now a fix is under way.

    Anyway another workaround is manually modifiying The "UAP,Version=v10.0.xxx" to "UAP,Version=v10.0" In the project.lock.json file. This has to be done on each build though so it can be cumbersome. But if the fix lands in a short while it might be better then installing an older version of visual studio!
     
  7. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    45
  8. ZeeNastalski

    ZeeNastalski

    Joined:
    Dec 12, 2016
    Posts:
    2
    Hi, I am having the same exception but coming from AssemblyConverter.exe. Also happens after I upgraded to 15.3. Is this the same problem? Will it also be addressed in the upcoming patch?
    Thanks!
    Zee

    Code (CSharp):
    1.  
    2. 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.'
    3. 1>------ Build started: Project: RoadToBirth, Configuration: Release x86 ------
    4. 1>d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\App.cs(56,13,56,71): warning CS0618: 'ApplicationView.SuppressSystemOverlays.set' is obsolete: 'Use the TryEnterFullScreen method and IsFullScreenMode property instead of SuppressSystemOverlays. For more info, see MSDN.'
    5. 1>  RoadToBirth -> d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\bin\x86\Release\RoadToBirth.exe
    6. 1>  UnityWSAPlayerDir "C:\Program Files\Unity2017.1.0f3\Editor\Data\PlaybackEngines\MetroSupport\".
    7. 1>  UnityProjectDir "".
    8. 1>  Copying unprocessed assemblies...
    9. 1>  Running AssemblyConverter...
    10. 1>  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
    11. 1>     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    12. 1>     at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve()
    13. 1>     at Unity.UWPAssemblyResolver..ctor(String projectLockFile, String desiredUWPSDKVersion)
    14. 1>     at Unity.OperationContext.SetPlatform(Platform platform, String projectLockFile, String uwpSDK)
    15. 1>     at Unity.ParseArgsStep.Execute()
    16. 1>     at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
    17. 1>     at Unity.Operation.Execute()
    18. 1>     at Unity.Program.Main(String[] args)
    19. 1>d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\RoadToBirth.csproj(301,9): error MSB3073: The command ""D:\UnityProjects\RoadToBirth\Hololens_2\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\project.lock.json" -bits=32 -configuration=Release -removeDebuggableAttribute=False -uwpsdk=10.0.15063.0 -path="." -path="C:\Program Files\Unity2017.1.0f3\Editor\Data\PlaybackEngines\MetroSupport\Players\UAP\dotnet\x86\Release" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\Assembly-CSharp-firstpass.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\Assembly-CSharp.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.Analytics.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.Timeline.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\nunit.framework.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.UI.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.HoloLens.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\HdgRemoteDebugRuntimeUWP.dll" "d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\UnityEngine.Networking.dll"" exited with code 1.
    20. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    21.  
     
  9. rowanG

    rowanG

    Joined:
    Jul 28, 2017
    Posts:
    4
    Yes that is the same issue. The workaround still applies.
     
  10. naatura

    naatura

    Joined:
    May 19, 2014
    Posts:
    8
    Did the beta fix the problem?
     
  11. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    45
    Technically yes, with the last update I could build, compile and deploy. But once I started the app nothing happened.

    Known issues from the last update.
    "XR: Windows Mixed Reality usage on b7 results in hangs and black screens at start-up. This has been fixed in b8 for VR HMDs, but is still an issue for HoloLens."
     
  12. Subere023

    Subere023

    Joined:
    Apr 27, 2016
    Posts:
    45
  13. ninja86

    ninja86

    Joined:
    Aug 6, 2013
    Posts:
    1
  14. waynebaby

    waynebaby

    Joined:
    Aug 23, 2017
    Posts:
    2
    Hey I have the same issue

    do you want to read “The given key was not present in the dictionary.” in Chinese?

     
  15. Timo1102

    Timo1102

    Joined:
    Jan 27, 2017
    Posts:
    3
    Hi, I have some interesting error while deploying on HoloLens. I have installed Unity Version 2017.2.0b7 and select ILCPP. In Visual Studio the build is fine but while deploying I have this error:

    Code (CSharp):
    1.  
    2. Error  DEP6720: Failed to deploy package 'Standard Collector Bridge'. DEP6959: Error removing the file from the remote device: 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\VSRemoteTools\x86\1031\DiagnosticsHubMsg.dll. Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)'.        
    3.  
    (The System can't find the file)
    Have anyone an idea to solve this?
     
  16. kkostkova

    kkostkova

    Joined:
    Jul 28, 2017
    Posts:
    2
    Hi,

    are there any command line parameters I could you while installing VS2017 that would install an older version? I have a vs_enterprise.exe installer, which installs the latest version. Through the links provided above, I can download only a trial version of the VS2017 enterprise, which would solve the problem only temporarily.

    Thanks.
     
  17. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    128
    I used VS2015, still can't build HoloLens
     
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,025
    What errors are you running into?
     
  19. sebrk_hiq

    sebrk_hiq

    Joined:
    Jul 10, 2017
    Posts:
    23
    Aah I just got this too. It was working just fine and then I decided to update Visual Studio 2017 using the updating tool. Too bad 2017 version of Unity3d doesnt play nice with Holotoolkit.

    I tried modifying the project.lock.json and sure enough it passes the SerializationLock. However it says it cannot find Assembly-CSharp.dll. Which is weird because it is actually located at the very path it says it cannot find. Maybe the file itself is not complete.

    When can we expect a solution to this?
     
    Last edited: Aug 28, 2017
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,025
    2017.1 and 2017.2 with the fixes are out. 5.6 should be coming out this week. 5.5 a bit later than that.
     
  21. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    128
    Similar to what I get using VS2017, something like first-pass.dll not found.
     
  22. sebrk_hiq

    sebrk_hiq

    Joined:
    Jul 10, 2017
    Posts:
    23
    I started getting this aswell. Both in VS2015 and VS2017.
     
  23. DanVioletSagmiller

    DanVioletSagmiller

    Joined:
    Aug 26, 2010
    Posts:
    147
    I'm on Unity 2017 latest, and building to HoloLens according to the Microsoft 101E instructions, using their foundation project. (https://developer.microsoft.com/en-us/windows/mixed-reality/holograms_101e)

    In Visual Studio 2017 with latest updates, I see the same KeyNotFound exception, which prevents the deployment to the holoLens. So I followed the instructions, and installed VS 2015. It complained that it needed to be updated to support that project type. So I let VS 2015 update. When it loaded in VS2015, appearantly Microsoft now has a limitation preventing this project type. I.e. it forces a message saying this must be loaded in 2017 instead.

    I have been bouncing around installs for almost a week now with no luck The problem still exists and seems to be worse now. At the moment, I'm installing Unity Beta (2017.2.0b9) to see if that can produce a project that will work in 2015 or 2017 for HoloLens.

    On a side note, a co-worker ran into similar issues and upgraded (downgraded) following this post about 10 days ago, and it worked for him. 2015 would load the project for him. Running same steps for me demands 2017.
     
  24. Creatovi

    Creatovi

    Joined:
    Sep 4, 2015
    Posts:
    3
    Update VS2017 to 15.3.3, just released yesterday, it works with Unity 2017.1.0p5 (tested with HoloToolkit 1.2017.1.0). Somebody here can try test with Unity 2017.2, might work as well. VS 15.3.2 just doesn't work.
     
  25. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,656
    Confirmed as well. Using the latest patch releases and VS 2017 15.3.3 resolves the issue.
    SO LONG as you UPDATE THE NETCORE NuGet :D after exporting
    Thanks for the help
     
  26. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,025
    The highest Windows SDK VS2015 supports is 10.0.14393. Perhaps you're on 10.0.15063? There is a setting in Unity build window where you can select which SDK to use.

    That is not helpful. Please paste the contents of the output window.
     
    DanVioletSagmiller likes this.
  27. Stevo013

    Stevo013

    Joined:
    Jan 12, 2017
    Posts:
    4
    Tautvydas-Zilys how to select wich SDK to use
     
  28. Stevo013

    Stevo013

    Joined:
    Jan 12, 2017
    Posts:
    4
    I figure it out To be able to Build your project Successfully with the visual studio 2015. Unity installs Visual studio 2015 when you install Unity "Note" so its on your computer if you have unity. When you Build your Universal Windows Game in unity. There is and option in the build settings when you are about to build your game That sais SDK. Switch From using latest version to using SDK version 10.0.14393, because Visual studio 2015 cant use any hire version than that and wont work. If you do this you will build out your game and it will work in visual studio 2015.
     
    wonderfultreestudio likes this.
  29. Stevo013

    Stevo013

    Joined:
    Jan 12, 2017
    Posts:
    4
    visually studio 2017 kept giving me NuGet error and i couldnt build .. . but ubove worked successfully ..
     
    wonderfultreestudio likes this.
  30. wonderfultreestudio

    wonderfultreestudio

    Joined:
    Jan 15, 2017
    Posts:
    10
    This is fun, developing in VS17, building in VS15 :D

    btw thx Stevo013...
     
  31. Xinli

    Xinli

    Joined:
    Aug 20, 2016
    Posts:
    4
    It seems that it is working now. I upgraded the Unity to 2017.1.1f1 to work with VS 15.3.3
     
unityunity