You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, in the .NET 8.0 version, we were able to access the image from the .resource file.
Issue description
I added an image file as a resource in my project and attempted to access the image using the ResourceManager. However, when running the application in .NET 9.0 (NET90), I encountered the following error:
System.PlatformNotSupportedException: 'BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.'
Interestingly, this approach works successfully when using .NET 8.0 (NET80). Below are the screenshots showing the issue in NET90 and the successful result in NET80:
NET90 Error Screenshot:
NET80 Success Screenshot:
Request: I need an alternate solution for accessing the .resources file in .NET 9.0, as the BinaryFormatter is no longer supported in this version. How can I successfully load and access resources, such as images, in .NET 9.0?
@SathiyathanamSathish can you please remove the tag for "everyone" in your comment above? That isn't actually tagging anyone involved with WinForms.
If you add your image resources via the "Resources File" template (which creates a .resx file where you can add the images), the embedded resource will be accessible without needing to take in the compatibility package. If you want to continue to use a pre-generated embedded resource file you'll need to use the compat package.
.NET version
.NET 9.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, in the .NET 8.0 version, we were able to access the image from the .resource file.
Issue description
I added an image file as a resource in my project and attempted to access the image using the ResourceManager. However, when running the application in .NET 9.0 (NET90), I encountered the following error:
System.PlatformNotSupportedException: 'BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.'
Interestingly, this approach works successfully when using .NET 8.0 (NET80). Below are the screenshots showing the issue in NET90 and the successful result in NET80:
NET90 Error Screenshot:
NET80 Success Screenshot:
Request: I need an alternate solution for accessing the .resources file in .NET 9.0, as the BinaryFormatter is no longer supported in this version. How can I successfully load and access resources, such as images, in .NET 9.0?
Steps to reproduce
New folder (2).zip
Observed behavior
Excepted behavior
The text was updated successfully, but these errors were encountered: