Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
LibVLCSharp
LibVLCSharp
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 82
    • Issues 82
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLAN
  • LibVLCSharpLibVLCSharp
  • Issues
  • #364

Closed
Open
Opened 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
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: videolan/LibVLCSharp#364