Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

HoloToolkit Sharing - How can I create persistent session from client?

I'm creating HoloToolkit Sharing Service session from C# console application.

Following is the Main function code:

using (XToolsApp xToolsApp = new XToolsApp())
Timer timer = new Timer(60);
timer.Elapsed += (source, e) => { xToolsApp.Update(); };

            NetworkConnectionData networkConnectionData = new NetworkConnectionData(xToolsApp)
                UserName = "TEST_USER",
                ServerAddress = "localhost:20602",
                ViewerAddress = "localhost:20603"
            xToolsApp.SessionManagerListener.SessionAdded += (session) =>
                if (session.GetName().GetString().Equals("Default", StringComparison.OrdinalIgnoreCase))
                    xToolsApp.CreateSession("TEST_SESSION", SessionType.PERSISTENT);

In above code, the statement "xToolsApp.CreateSession("TEST_SESSION", SessionType.PERSISTENT);" calls the following function.

public bool CreateSession(string sessionName, SessionType sessionType)
XString nameXString = new XString(sessionName);
LogWriteLine("Creating Session " + sessionName);
if (!this.SessionManager.CreateSession(nameXString, sessionType))
LogWriteLine("Failed to request a new session!");
return false;
return true;

Further, in above code, the statement "this.SessionManager.CreateSession(nameXString, sessionType)" calls the following function, part of HoloToolkit.Sharing namespace's auto generated SessionManager.cs class

public virtual bool CreateSession(XString sessionName, SessionType type) {
bool ret = SharingClientPINVOKE.SessionManager_CreateSession__SWIG_1(swigCPtr, XString.getCPtr(sessionName), (int)type);
return ret;

But it is still creating ADHOC session (not PERSISTENT). What should I do to create PERSISTENT session?


  • @GurpreetSingh,
    Have you filed an issue in the HoloToolkit-Unity GitHub repository? I highly recommend reporting issues there so the community working on the HoloToolkit is directly made aware of and address the problems you are seeing.


Sign In or Register to comment.