'UnmanagedType.VBByRefStr Obsolete

I have this 3-party dll and the import declarations they provide uses UnmanagedType.VBByRefStr for marshaling strings. Works without problems. However, VS now says that UnmanagedType.VBByRefStr is obsolete. I have tried LPWStr and other species without success (access violation....). Is there a way to get around this? I can not change the dll, no source for that.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source