Member Avatar
SeniorAlexandro

Alright, I have a Form with a Media Player in it. Which plays a Song.

AxWindowsMediaPlayer1.URL = My.Computer.FileSystem.CurrentDirectory & "\Music.mp3"
AxWindowsMediaPlayer1.Ctlcontrols.play()
AxWindowsMediaPlayer1.settings.playCount = 999
Me.Opacity = 0

It's playing in the background since the Form is hidden.
When I play it in Debug, everything works fine.
When I run the app outside Debug, I get this error: http://i42.tinypic.com/21azs5j.png
The Music File is there, but strangely, there comes this weird error.

Member Avatar
SeniorAlexandro

I tried to add a Reference (Axinterop.wmpLib.dll) but now I get this Error: "AxWindowsMediaPlayer" is ambiguous in the namespace "AxWMPLib"

Member Avatar
SeniorAlexandro

I deleted all the Files that have to do with Ax....now I don't get them back....please help me. I am desperated.

Start a new.project, add your wmp(WindowsMediaPlayer) to Form, Then modify code w/this.

Try
            '// wmp.code here.
        Catch ex As Exception
            MsgBox(ex.Message) '// displays error.msg and does not crash app.  error.msg is not necessarly needed.
        End Try

If you get an error.msg, post the result.

Member Avatar
SeniorAlexandro

I found out what the problem was. It runs fine in the Debug, because the DLL Files are there.
If you move the .exe outside Debug, it's missing the DLL's, so it will give you an error.
SOLUTION: Paste the DLL's into the same directory where the .exe is located.