Unmanaged code and AppDomain

Options
Hi!
I'm developing a game on C++ that sharing a lot logical code with server, so i'm using Managed C++ on server side. But i have a problem like this: https://www.codeproject.com/KB/mcpp/442784/DefaultAppDomain2.png . This happens when i'm using static unmanaged variables with destructor like this:
std::string func() {
static std::string s;
return s;
}

As i pointed, i can fix it by using Default Domain, and, as i see, Photon creating it's own (not default) App Domain.
I know that i can fix it using #pragma managed(push, off)/#pragma managed(pop) wrappers, but, as i say before, i'm sharing code between server and client (that runs on ios/anroid), so this way is so painfull..
So, my question is: how can i use in Photon (in GameServer) a Default Domain?

Sorry for my English and Thank You!

Comments

  • chvetsov
    Options
    hi, @kalibannez

    by design you can not work in Default domain. so we would recommend you to update your code so, that it does not have such issues

    could you use PInvoke techink?

    best,
    ilya
  • hi, @chvetsov

    i have a lot of communications with native C++ code and backward, i'm afraid that PInvoke is worse than pragma push/pop in my case..

    Ok, thank you anyway, ilya!