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.
I lose WorldAnchors when switching between Debug and Release builds.
I'm developing using the Unity SDK. World anchors are pretty great no problem using them but when I change build modes all of my stored anchors disappear. I can understand having separate stores for release and debug but to have the debug store deleted when run in release mode and vice versa is pretty frustrating. Is there anything you can do to prevent this from happening?
I was looking at the ImportExportAnchorManager which seems to imply I could store anchors outside of the provided WorldAnchorStore if I wanted to but it seems like this is something that should be handled.
Best Answer
-
OptionsPatrick mod
I think I have the process figured out. The trick is to have two (or three if you consider master) package.appxmanifest files. Name one debug_package.appxmanifest and the other release_package.appxmanifest.
Then in each of these appxmanifest files change any string that looks like a display name of the app. I doubt they all need to be changed.
And change the PhoneProductId to a new GUID. I incremented the last digit in my GUID.then add this to the prebuild command line:
xcopy /y "$(ProjectDir)$(ConfigurationName)_package.appxmanifest" "$(ProjectDir)package.appxmanifest"I tested this in the emulator. I haven't been able to confirm that this will allow switching between debug and release without losing the local anchor store for the app, but I believe it will.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.(Daddy, what does 'now formatting drive C:' mean?)
6
Answers
The anchors are stored in the context of your application. Debug and release are, pedantically, different applications. You could export the serialized anchor to one of the user's library folders on the HoloLens and import the anchor in the other flavor.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.
(Daddy, what does 'now formatting drive C:' mean?)
I understand that they would have different context but why does loading another context erase the previous?
I guess I'll just have to write a serializer/saver. I try and post back here if I ever get around to it.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.
(Daddy, what does 'now formatting drive C:' mean?)
I think I have the process figured out. The trick is to have two (or three if you consider master) package.appxmanifest files. Name one debug_package.appxmanifest and the other release_package.appxmanifest.
Then in each of these appxmanifest files change any string that looks like a display name of the app. I doubt they all need to be changed.
And change the PhoneProductId to a new GUID. I incremented the last digit in my GUID.
then add this to the prebuild command line:
xcopy /y "$(ProjectDir)$(ConfigurationName)_package.appxmanifest" "$(ProjectDir)package.appxmanifest"
I tested this in the emulator. I haven't been able to confirm that this will allow switching between debug and release without losing the local anchor store for the app, but I believe it will.
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.
(Daddy, what does 'now formatting drive C:' mean?)
Thanks I'll try this and report back
Seems to have done the trick. Obviously there are now two instances of the app in the "start menu" but I don't lose anchors now.