std::string and c# string are not compatible with each other. As far as I know the c# string corresponds to passing char*
or wchar_t*
in c++ as far as interop is concerned.
One of the reasons for this is that There can be many different implementations to std::string and c# can’t assume that you’re using any particular one.