Adding reference to Visual Studio project [#17897]

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

bensynnock
Posts: 12
Joined: Thu Oct 11, 2012 3:23 pm

Adding reference to Visual Studio project [#17897]

Post by bensynnock »

I have a couple of visual studio projects that I wrote to work with MM4 which I'd like to get updated for MM5 and I'm getting an error when I try to add the reference to Mediamonkey's COM object to the project, as per this page:

https://www.mediamonkey.com/wiki/Contro ... plications

"For .NET-based applications, you must also add a reference to MediaMonkey's COM object "MediaMonkey Library" to your Visual Studio project, so that the compiler can find MediaMonkey and the SongsDB5 namespace."

I can see the Mediamonkey COM object in the list, but when I try to add it I get an error: "A task was cancelled". I clear the error and then Visual Studio goes not responding.

I also get the same error when adding it to a new project, and its a new installation of Visual Studio on this machine.

Has anybody managed to get this working in Visual Studio? Maybe I'm missing something obvious.
drakinite
Posts: 470
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Adding reference to Visual Studio project

Post by drakinite »

Sorry, that snipped that you quoted was copied from the original MM4 scripting wiki page by me. (https://www.mediamonkey.com/wiki/Introd ... _scripting) If you have an external application that uses the COM model to communicate with MM, it should behave the same as with MM4 except that it uses the SongsDB5.SDBApplication namespace instead of SongsDB.SDBApplication - aside from a number of known issues with the Player object that are on the todo list (https://www.ventismedia.com/mantis/view.php?id=17174)

If that snippet is not relevant or incorrect, I'll remove it. When you attempt the same thing with the MM4 COM object, do you get the same issue or does it work for you?
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
bensynnock
Posts: 12
Joined: Thu Oct 11, 2012 3:23 pm

Re: Adding reference to Visual Studio project

Post by bensynnock »

Thanks for your reply.

I've gone through it all again, removed all the existing references from the project and re-added the MM4 COM reference with no problem. Then removed it again and attempted to add the MM5 reference with the same error as above. The same thing happens with an otherwise blank project.


Its a new installation of Win10, and a new installation of VS2019 also.
bensynnock
Posts: 12
Joined: Thu Oct 11, 2012 3:23 pm

Re: Adding reference to Visual Studio project

Post by bensynnock »

It would be really helpful if anybody who has managed to get the com reference to work in visual studio 2019 to let me know what version of VS they are using please. If anybody has visual studio installed and hasn't tried to add the com reference then I'd be grateful if they could give it a go and let me know what happens.

I'm getting the same error with two different PCs, both of which have fresh installs of windows 10, fresh installs of visual studio, and of mediamonkey 5.
drakinite
Posts: 470
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Adding reference to Visual Studio project

Post by drakinite »

Hi, sorry for the late response. I'm not the most experienced with Visual Studio, but I'll do some tests and see if I can come up with something.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
TIV73
Posts: 131
Joined: Sat Nov 12, 2011 1:31 pm

Re: Adding reference to Visual Studio project

Post by TIV73 »

Do you have the projects published somewhere?
drakinite
Posts: 470
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: Adding reference to Visual Studio project

Post by drakinite »

I can reproduce the issue on Visual Studio 2017; tracked as https://www.ventismedia.com/mantis/view.php?id=17897. Sorry about the trouble. Is your project for a separate application that runs alongside MM, or for an addon that will run within MM? If it's the latter, it may be worth trying out using JavaScript for the addon, which will let it be used on multiple platforms when it comes time for Mac MM. :grin:
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Post Reply