In fact i always attach VS on tvservice from 'C:\Program Files (x86)\Team MediaPortal\MediaPortal TV Server' but if i set tvservice as startup project and start from it (vs) -> Pinvoke
And from ms have this message can lead to crash because of a leak etc.
Ok seems to be fixed :
The change was to :
[DllImport("StreamingServer.dll", CharSet = CharSet.Ansi)]
to
[DllImport("StreamingServer.dll", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]