Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • LibVLCSharp LibVLCSharp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 77
    • Issues 77
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLAN
  • LibVLCSharpLibVLCSharp
  • Issues
  • #364

Closed
Open
Created Jul 07, 2020 by TomDeFord@TomDeFord

TypeLoadException: LibVLCSharp.Shared.MediaPlayerElement.IVideoControl for any Forms WPF project

Summary

Loading Forms sample projects LocalNetwork (libvlcsharp-samples) & LibVLCSharp.Forms.Sample yields a TypeLoadException for LibVLCSharp.Shared.MediaPlayerElement.IVideoControl when running the WPF sample; the associated Android projects in the same solution run fine.

Minimal project and steps to reproduce

Create solution from LocalNetwork using following Forms sample projects:

  • LocalNetwork
  • LocalNetwork.Android
  • LocalNetwork.WPF

or from LibVLCSharp.Forms:

  • LibVLCSharp.Forms.Sample
  • LibVLCSharp.Forms.Sample.Android
  • LibVLCSharp.Forms.Sample.WPF

Run WPF as default project.

What is the current bug behavior?

Running Android samples run fine. Running LocalNetwork.WPF yields following exception:

System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='The invocation of the constructor on type 'LocalNetwork.WPF.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position '9'.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

Inner Exception 1:
TypeLoadException: Could not load type 'LibVLCSharp.Shared.MediaPlayerElement.IVideoControl' from assembly 'LibVLCSharp, Version=3.4.5.0, Culture=neutral, PublicKeyToken=null'.

Running LibVLCSharp.Forms.Sample.WPF gives same TypeLoadException for LibVLCSharp.Forms.WPF.Sample.MainWindow.

Does it work on other plaforms? Does it work with the official VLC apps?

Android projects work fine.

Environment

  • VS2019
  • Windows 10
  • LibVLCSharp 3.4.5
  • VideoLAN.LibVLC.Android 3.2.0
  • VideoLAN.LibVLC.Windows 3.0.11

Possible fixes

Possibly IVideoControl being set as Internal? Not sure why a MediaPlayerElement type exception as I was using VideoView?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking

VideoLAN code repository instance