简体   繁体   中英

HoloLens Failed Build Visual Studio 2017

My question is related to this post , but I wanted to open a new thread for a slight variation of the problem.

I get the same error message running in Visual Studio 2017, and in the post, the stated workaround was to run the solution in Visual Studio 2015 instead. However, when I try to deploy in 2015, it gives me an error message saying I'm targeting the Windows 10 Creators Update and therefore need an updated version of Visual Studio to run it (which is, of course, 2017).

Does anyone know how to get around this or how to stop it from targeting the Creators Update? I'm writing my thesis using a HoloLens, so I'm on a very tight time crunch, unfortunately. :(

Thank you!!

PS The Unity website has marked this bug as resolved in Unity 2017, but I still get the bug on 2017.2, so updating Unity won't help.

Ok, I actually found a workaround for anyone else who has this same problem.

1) Build your Unity project as usual and then run it once in VS2017.

2) This build will fail, but it will generate your project.lock.json file.

3) Open that file (I just did this by searching for "project.lock.json" in my build file in file explorer) and look under the "targets" tag.

4) There will be quite a few lines that specify the target version. It will look like this:

"targets": {
    "UAP,Version=v10.0.xxxxxx": ... ,
    "UAP,Version=v10.0.xxxxxx/win10-arm": [...] ,
    "UAP,Version=v10.0.xxxxxx/win10-arm-aot": [...] ,
    "UAP,Version=v10.0.xxxxxx/win10-x64": [...] ,
    "UAP,Version=v10.0.xxxxxx/win10-x64-aot": [...] ,
    "UAP,Version=v10.0.xxxxxx/win10-x86": [...] ,
    "UAP,Version=v10.0.xxxxxx/win10-x86-aot": [...] ,
}

Change all of those target versions to just v10.0 so it looks like this:

 "targets": {
    "UAP,Version=v10.0": ... ,
    "UAP,Version=v10.0/win10-arm": [...] ,
    "UAP,Version=v10.0/win10-arm-aot": [...] ,
    "UAP,Version=v10.0/win10-x64": [...] ,
    "UAP,Version=v10.0/win10-x64-aot": [...] ,
    "UAP,Version=v10.0/win10-x86": [...] ,
    "UAP,Version=v10.0/win10-x86-aot": [...] ,
}

5) Now run again in Visual Studio 2017 and it should be fixed!

Be sure to go give this hero an up-vote for finding the workaround first ( https://forums.hololens.com/discussion/8382/hololens-universal10-build-json-dll-error-solve#latest )!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM