public VlcInstance(string pathToVlc) { if (string.IsNullOrEmpty(pathToVlc)) { pathToVlc = @"c:\Program Files\VideoLAN\VLC\"; } string aCurrentDirectory = Directory.GetCurrentDirectory(); Directory.SetCurrentDirectory(pathToVlc); try { InstanceHandle = LibVlc.libvlc_new(0, null); if (InstanceHandle == IntPtr.Zero) { throw new VlcException(); } } finally { Directory.SetCurrentDirectory(aCurrentDirectory); } }