I'm trying to make a movie play in my application:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim audioFile As Audio = New Audio("My.Resources.MyMovie.mov")
audioFile.Play()
End Sub
MyMovie is a .mov
file and is saved under My.Resources
and I want to access that file in vb.net program. When a button is clicked, I want that movie to play. The problem is, when I clicked the button, I receive this error:
Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
As well as the above error, I also get the following:
FileLoadException was unhandled.
You're attempting to use an older library with a newer version of .NET. In an ideal world, every library would be built & updated for the newest platform, but this isn't the case.
useLegacyV2RuntimeActivationPolicy
needs to be set totrue
in yourapp.Config
file, for example:Obviously if you use a higher version of .NET than 4.0, you need to swap out the version parameters
Version=v4.0
andVersion="v4.0"
to the version you're using.Additional information on the
<startup>
element can be found here, from the official documentation I linked:The
FileLoadException was unhandled.
error is caused by the above.