stigzler Posted Thursday at 08:06 PM Posted Thursday at 08:06 PM (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 Thursday at 08:16 PM by stigzler Quote
superrob3000 Posted Thursday at 08:13 PM Posted Thursday at 08:13 PM If you upgrade the plugin to .net 9 using the upgrade assistant in visual studio it will fix that error. 1 Quote
stigzler Posted Thursday at 08:17 PM Author Posted Thursday at 08:17 PM 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. Quote
superrob3000 Posted Thursday at 08:19 PM Posted Thursday at 08:19 PM 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. Quote
stigzler Posted Thursday at 08:34 PM Author Posted Thursday at 08:34 PM 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! Quote
superrob3000 Posted Thursday at 08:41 PM Posted Thursday at 08:41 PM 5 minutes ago, stigzler said: However - is there a "reverse" upgrade option? You mean to undo it if it doesn't go well? I wouldn't attempt that. Just make a copy of it first. Quote
stigzler Posted Thursday at 08:46 PM Author Posted Thursday at 08:46 PM 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! 🤣 Quote
JoeViking245 Posted Thursday at 08:54 PM Posted Thursday at 08:54 PM 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). Quote
stigzler Posted Thursday at 08:59 PM Author Posted Thursday at 08:59 PM 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. Quote
JoeViking245 Posted Thursday at 09:09 PM Posted Thursday at 09:09 PM 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? Quote
stigzler Posted Thursday at 09:22 PM Author Posted Thursday at 09:22 PM Oh gosh, no. But I know my own limitations and the state of my code! 😉 Quote
stigzler Posted Thursday at 09:39 PM Author Posted Thursday at 09:39 PM So is this good or bad? Looks baaaad to me: Quote
stigzler Posted Friday at 09:11 PM Author Posted Friday at 09:11 PM 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.