Jump to content
LaunchBox Community Forums

Recommended Posts

Posted (edited)

Think this likely has something to do with the .net version update. Error thrown at my entry point class inheriting ISystemMenuItemPlugin:

    public class SystemMenuItemHook : ISystemMenuItemPlugin
    {
        // Launchbox Properties ==============================================================================================

        public string Caption => "Gearbox";
        public System.Drawing.Image IconImage => Gearbox.Presentation.Properties.Resources.gearboxicon;
        public bool ShowInLaunchBox => true;
        public bool ShowInBigBox => false;
        public bool AllowInBigBoxWhenLocked => false;

        // Gearbox Properties ==============================================================================================

        public SystemMenuItemHook()
        {
        }

        public void OnSelected()
        {
			// Blah - problem not here
        }

    }

Gearbox.Presentation.Properties.Resources.gearboxicon throws the error:

"System.PlatformNotSupportedException: 'BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.'"

gearboxicon shows as a System.Drawing.Bitmap and is included via the Vis Studio Resources system. 

This has been working fine for all past versions. 

Plugin built using Framework 4.8

Any ideas?

Edited by stigzler
Posted
2 minutes ago, superrob3000 said:

If you upgrade the plugin to .net 9 using the upgrade assistant in visual studio it will fix that error.

Thanks, Rob, but forgot to mention that it's built using Framework 4.8 - so not sure how easy it is to switch to .net 9. 

Posted
Just now, stigzler said:

Thanks, Rob, but forgot to mention that it's built using Framework 4.8 - so not sure how easy it is to switch to .net 9. 

It should be very easy if you use Visual Studio's Upgrade Assistant tool. I had to update all my plugins from 4.7.4 framework to .net 9 and it has been mostly painless.

Posted
11 minutes ago, superrob3000 said:

It should be very easy if you use Visual Studio's Upgrade Assistant tool. I had to update all my plugins from 4.7.4 framework to .net 9 and it has been mostly painless.

Cheers dude. @JoeViking245 has suggested referencing LB/Core/Drawing.Common - so need to find a way to try this first as my plugin is v complicated (5 projects + leveraging some potential framework only features) - so if Joe's suggestion works this would be the preferable path rather than the upgrade. However - is there a "reverse" upgrade option? The Framework/Core/.net transition is one I've never braved!

Posted

 

4 minutes ago, superrob3000 said:

You mean to undo it if it doesn't go well? I wouldn't attempt that. Just make a copy of it first.

Oh, I WILL be doing a commit if I do it! 🤣

Posted
16 minutes ago, stigzler said:

Cheers dude. @JoeViking245 has suggested referencing LB/Core/Drawing.Common - so need to find a way to try this first as my plugin is v complicated (5 projects + leveraging some potential framework only features) - so if Joe's suggestion works this would be the preferable path rather than the upgrade. However - is there a "reverse" upgrade option? The Framework/Core/.net transition is one I've never braved!

I missed that you were on NET Framework.  Not sure if that'd still work. 

Just do what SuperRob suggested and do the upgrade.  But yeah, make a backup 1st (just copy the folder the whole solution is in and save it somewhere).

Posted
1 minute ago, JoeViking245 said:

I missed that you were on NET Framework.  Not sure if that'd still work. 

Just do what SuperRob suggested and do the upgrade.  But yeah, make a backup 1st (just copy the folder the whole solution is in and save it somewhere).

Thanks Joe. God I've got a horrible feeling this is going to go really, really badly. :/

Posted
8 minutes ago, stigzler said:

Thanks Joe. God I've got a horrible feeling this is going to go really, really badly. :/

Not sure what you're worried about.  You had 2 different plugin developers tell you to do it.  You think we're trying to sabotage you? ;) 

Posted

God that was bloody horrible. Never make me do that again....

12 hours straight and finally upgraded about 7 different projects to .net 9. To be fair to M$ - their Upgrade tool is really good. The hassle came from resolving references and fixing breaking changes in .net 9. Curses! I know I'm going to be finding bugs for a while yet..

Goodbye Framework - you served me well, but like an ex-wife - don't think I'll be visiting for tea again any day soon. 

So yes, in conclusion, upgrading to .Net9 solves this issue. However, if you've got any kind of complexity (read: multi-local library, old platform etc) make sure to bring a 4-pack of patience. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...