The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
BadImageFormatException when deploying on Hololens
I'm currently part of a small team working on a project for HoloLens. We're facing a problem when deploying on an unit: My team-mate can deploy from his computer and run the program, but when I do it from mine, on the same unit, it refuses to launch and throws a BadImageFormatException.
If I deploy the same program, from my computer, but on another HoloLens it works flawlessly.
The emulator works too, but there are too many limitations for what we intend to do.
Has any other team encountered the same problem when deploying the same program from two different computers to a single HoloLens ?
Best Answer
-
Optionsjbienzms mod
Make sure everyone is running the exact same bits in Visual Studio. Make sure you're both on Visual Studio Update 3 and make sure you've gone into Tools -> Extensions and Updates and completed all updates there that have anything to do with UWP or Universal. Also make sure you're running exactly the same version of Unity. Finally, make sure your HoloLens is fully updated.
After all that is done, uninstall the app from the HoloLens, do a full rebuild starting from Unity and then through Visual Studio, and then deploy it to the HoloLens again. Theoretically, I hope at this point your problem is solved.
Visual Studio also has an option under project properties to uninstall and fully reinstall the app on the device. I don't think you should have to use that, but if you keep getting that far out of sync between the two dev machines that may help.
Our Holographic world is here
RoadToHolo.com WikiHolo.net @jbienz
I work in Developer Experiences at Microsoft. My posts are based on my own experience and don't represent Microsoft or HoloLens.5
Answers
I've seen BadImageFormatException in non hololens UWP projects that were targeting the wrong cpu.
Can you confirm you are building to x86 and all of your libraries are targeting x86 as well?
Taqtile
I confirm
This is also verified by the fact that I can deploy that same code on another HoloLens device without any problem. But yes, just in case everything has been double-checked. Unity "builds" the app for HoloLens, and Visual Studio builds it (for real) to x86.
This only happens when someone deployed a version of the app from his computer on a device, and somone else, later, tries to deploy another version of that same app on that same device, but from another computer.
Visual Studio only pushes the modifications in the package, and doesn't delete every reference of the app before re-deploying a clean, new one.
Or maybe I'm wrong about the reasons why this is happening.
I'll try to make Visual Studio uninstall and reinstall the package on deployment, tomorrow at the office. I hope it will be enough.
Make sure everyone is running the exact same bits in Visual Studio. Make sure you're both on Visual Studio Update 3 and make sure you've gone into Tools -> Extensions and Updates and completed all updates there that have anything to do with UWP or Universal. Also make sure you're running exactly the same version of Unity. Finally, make sure your HoloLens is fully updated.
After all that is done, uninstall the app from the HoloLens, do a full rebuild starting from Unity and then through Visual Studio, and then deploy it to the HoloLens again. Theoretically, I hope at this point your problem is solved.
Visual Studio also has an option under project properties to uninstall and fully reinstall the app on the device. I don't think you should have to use that, but if you keep getting that far out of sync between the two dev machines that may help.
Our Holographic world is here
RoadToHolo.com WikiHolo.net @jbienz
I work in Developer Experiences at Microsoft. My posts are based on my own experience and don't represent Microsoft or HoloLens.
Thanks !
jbienzms is right, we had to check the "uninstall and then rinstall my package" for it work.
Now we can collaborate