Directory Not Found Exception or FileNotFoundException on VLC.DotNet Directory Not Found Exception or FileNotFoundException on VLC.DotNet wpf wpf

Directory Not Found Exception or FileNotFoundException on VLC.DotNet


The problem is definitely with your library path, though you have to debug the problem yourself in order to find the exact discrepancy between provided path and actual path.

The misunderstanding may be, which libraries are missing. You do have the Vlc.DotNet.Core.Interops.dll but your are missing the nativ libraries behind. This is the reason, why the exception occurs inside Vlc.DotNet.Core.Interops.dll when it tries to load the actual libraries.

The OnVlcControlNeedsLibDirectory function is called inside VLCControl.MediaPlayer.Play(src);, so the Path from OpenFileDialog has nothing to do with the problem.

Steps I taken to reproduce / fix:

  • Downloaded your project
  • Tested / Debugged
    • Exception occurred as you describe
  • Downloaded the libraries from Vlc.DotNet repository
  • Changed the paths to absolute values
  • Tested / Debugged again
    • Successfully played a music file
    • Another exception occured on closing (different story alltogether)

My folder layout:

Solution path:

D:\Programmierung\VLCTest-VAlphaTesting\VLCTest-VAlphaTesting\

Actual Assembly location on execute

D:\Programmierung\VLCTest-VAlphaTesting\VLCTest-VAlphaTesting\VLCTest\bin\Debug

ProcessorArchitecture: x86

Library Path:

D:\Programmierung\Vlc.DotNet-master\Vlc.DotNet-master\lib\x86

Contents of library path:

plugins (folder)

.keep (file)

libvlc.dll (file)

libvlccore.dll (file)

For testing purposes I hardcoded the library path - you may want to do that as well

if (AssemblyName.GetAssemblyName(currentAssembly.Location).ProcessorArchitecture == ProcessorArchitecture.X86)    e.VlcLibDirectory = new DirectoryInfo(@"D:\Programmierung\Vlc.DotNet-master\Vlc.DotNet-master\lib\x86");else    e.VlcLibDirectory = new DirectoryInfo(@"D:\Programmierung\Vlc.DotNet-master\Vlc.DotNet-master\lib\x64");