2

I am compiling a solution using Visual Studio 2019. This solution has two projects, we can call them Common and Program. Program depends on Common and Common depends on the NuGet packages LibVLCSharp, LibVLCSharp.WPF and VideoLAN.LibVLC.Windows.

If I clean and then build Program, everything is fine: the dlls are correctly copied in bin/Debug or bin/Release. But if I make any change to Program and compile it without cleaning it, the dlls relative to VLC disappear.

What can be the reason for the dlls to disappear? In the visual studio UI I do not see the commands it is running when I compile the project. How can I debug it?

Ottavio Campana
  • 4,088
  • 5
  • 31
  • 58
  • Were the DLL's copied manually, or as part of the NuGet packages themselves? – user2864740 May 19 '20 at 09:06
  • 1
    part of the NuGet packages – Ottavio Campana May 19 '20 at 09:08
  • You can get it here https://send.firefox.com/download/08f48d8662a0429d/#8TKugBxrrSRbGpC4i0ogaA . As I said, clean Program, then compile it. in bin/Debug you'll find libvlc/win-x86/libvlc* . Then just add an empty space to the MainWindow.xaml , compile Program without cleaning and you will not fild the dlls under bin/Debug/libvlc/win-x86 . – Ottavio Campana May 19 '20 at 10:05
  • You could try to build with the diagnostic verbosity option – mfkl May 19 '20 at 11:33
  • Files sent with Firefox Send expire after a while. This is not a good platform to share code for a StackOverflow question. It is better to host the code on github for example, where permalinks can be created, so that future readers can look at it and know if they have the same issue. – cube45 May 19 '20 at 12:20
  • 1
    Ok, i put a copy on https://github.com/ocampana/missingdlls – Ottavio Campana May 19 '20 at 14:02

1 Answers1

2

It seems that you are referencing VideoLAN.LibVLC.Windows on your Common project rather than in your Program project. This is not a scenario that we support.

I wrote this explanation about which project you should install LibVLC in.

In short, you should install the LibVLC package only into your application project, because we insert a build step that copies the files to the Output Folder of your project.

If you reference the LibVLC project in the Common project, there is no way we can copy the files to the Program project, because it is not known by MSBuild. You would then have to tell MSBuild to copy those files from Common/bin/... to Project/bin/..., but trust me, you don't want to mess with MSBuild.

EDIT: That doesn't mean that you can't use LibVLCSharp in your Common project. You can reference the LibVLCSharp packages in your Common project, because it only depends on VideoLAN.LibVLC.Windows at runtime.

cube45
  • 3,429
  • 2
  • 24
  • 35