954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Axinterop.wmpLib.dll works OK in debug build, not OK in release build

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 itin 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.

Aangiix3
Newbie Poster
20 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

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

Aangiix3
Newbie Poster
20 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

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

Aangiix3
Newbie Poster
20 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

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.

codeorder
Posting Virtuoso
1,913 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

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.

Aangiix3
Newbie Poster
20 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: