Unable to build even an empty project.

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:

  • New unity project.
  • Build for UWP->Hololens. This works.
  • Open resulting solution in visual studio and try to build there.

Then the build breaks when issuing the command “SerializationWeaver.”

With the following traceback:

Restoring NuGet packages...
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.'
1>------ Build started: Project: Assembly-CSharp-firstpass, Configuration: Debug ARM ------
1>  Running SerializationWeaver...
1>  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
1>     at System.ThrowHelper.ThrowKeyNotFoundException()
1>     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
1>     at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve()
1>     at Unity.NuGetAssemblyResolver..ctor(String projectLockFile)
1>     at usw.Weaver.ReaderParameters(String assemblyPath, ConversionOptions options)
1>     at usw.Weaver.Weave()
1>     at usw.Program.RunProgram(ConversionOptions options)
1>     at usw.Program.Main(String[] args)
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.
========== 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.

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/UnityDecompiled/blob/master/UnityEditor/UnityEditor.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

2 Likes

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

At least i believe so…

Yup, that’s the same issue. Workarounds involve either using il2cpp scripting backend for now, or using VS2015 to build the project.

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!

Looks like the fix went live while I was out for dinner. New beta up.

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

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.'
1>------ Build started: Project: RoadToBirth, Configuration: Release x86 ------
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.'
1>  RoadToBirth -> d:\UnityProjects\RoadToBirth\Hololens_2\RoadToBirth\bin\x86\Release\RoadToBirth.exe
1>  UnityWSAPlayerDir "C:\Program Files\Unity2017.1.0f3\Editor\Data\PlaybackEngines\MetroSupport\".
1>  UnityProjectDir "".
1>  Copying unprocessed assemblies...
1>  Running AssemblyConverter...
1>  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
1>     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
1>     at UnityEditor.Scripting.Compilers.NuGetPackageResolver.Resolve()
1>     at Unity.UWPAssemblyResolver..ctor(String projectLockFile, String desiredUWPSDKVersion)
1>     at Unity.OperationContext.SetPlatform(Platform platform, String projectLockFile, String uwpSDK)
1>     at Unity.ParseArgsStep.Execute()
1>     at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
1>     at Unity.Operation.Execute()
1>     at Unity.Program.Main(String[] args)
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.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Yes that is the same issue. The workaround still applies.

Did the beta fix the problem?

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.”

I am in the process of downgrading my VS2017 version as I type.

https://my.visualstudio.com/Downloads?pid=2210

you are right :slight_smile: thank you I have a headache because of this build prob

Hey I have the same issue

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

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:

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)'.

(The System can’t find the file)
Have anyone an idea to solve this?

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.

I used VS2015, still can’t build HoloLens

What errors are you running into?

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?

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.