Upgrade from 3.x
Previously, upgrading to Wisej.NET 4 involved a complex process that required replacing instances of System.Drawing.Bitmap
with Wisej.Base.ResourceImage
. However, with the latest build, the requirement to use Wisej.Base.ResourceImage has been eliminated and the class has been removed. This update simplifies the upgrade process and enhances ease of development, making it more straightforward for developers to transition to the latest version.
Overview
Transitioning to Wisej.NET 4 and the .NET Core Designer requires replacing these two classes:
System.Resources.ResourceManager
⇒Wisej.Resources.ResourceManager
System.ComponentModel.ComponentResourceManager
⇒Wisej.Resources.ComponentResourceManager
The rationale behind this change is that the implementation of System.Resources.ResourceManager
in .NET loads the specific type specified in the resources file without providing a way to override its behvior. Consequently, when dealing with embedded images, this approach fails on Linux systems without the installation of libgdiplus
, and it is inherently incompatible with iOS and Android devices, resulting in failure on those platforms as well.
Our re-implementation maintains full compatibility with all existing resources and is flexible enough to adapt to the target platform seamlessly. On Windows, it utilizes System.Drawing
(GDI+), while on all other platforms, it leverages our newly developed System.Drawing.Managed
, which is based on ImageSharp.
The new Wisej.Resources.ResourceManager
is available in Wisej.NET starting with build 3.5.18 to ensure backward compatibility from 4.0.
The replacement is necessary solely for managing embedded images. Generally, you will notice extensive use of the ResourceManager
in all .Designer.cs and .Designer.vb files.
ResXFileCodeGenerator
Since the .Designer.cs or .Designer.vb file associated with a project's resources is automatically generated by Visual Studio using the ResXFileCodeGenerator
tool, we have replaced it to ensure that the generated code utilizes the updated types introduced with Wisej.NET 4.
If you target only .NET Framework
, these changes don't apply to you.
Upgrade Tool
The Upgrade Tool is designed to automate the migration of .Designer.cs/vb
files by replacing the ResourceManager
references.

The tool applies the following modifications:
ComponentResourceManager Replaces all references to
System.ComponentModel.ComponentResourceManager
toWisej.Resources.ComponentResourceManager
. These are commonly found nested under the project's .resx files.ResourceManager
Replaces all references to
System.Resources.ResourceManager
toWisej.Resources.ResourceManager
. These are commonly found in the designer files related to visual components.
Binary Serialization in Resx
See also Binary Formatter and NET 9. Beginning with .NET 9, Microsoft removed the binary formatter (serializer) from the core framework and made it available as a separate package through NuGet. As a result, some existing .resx files may be incompatible with .NET 9 and newer versions unless you import the System.Runtime.Serialization.Formatters
package from NuGet.
To identify affected .resx files, you can search for the MIME type "application/x-microsoft.net.object.binary.base64" across your *.resx files. This will help you locate the instances that require the binary formatter so you can address compatibility issues.
Wisej.NET utilized this type of serialization, which is entirely safe, to store RulerSnapLines
and ResponsiveProfiles
within .resx files. If you encounter other instances of binary serialization, you will need to either contact the component vendor responsible for serializing those values or use the System.Runtime.Serialization.Formatters package to maintain compatibility.
Rest assured, there are no security concerns when using this binary serialization within design files.
Once you open the designer for the affected view and save it back, Wisej.NET will automatically re-serialize those properties using the MIME type "application/x-microsoft.net.object.bytearray.base64". This enhancement not only resolves compatibility issues but also provides an additional advantage: Responsive Profiles are now supported when running a hybrid Wisej.NET application on iOS or Android devices.
Last updated
Was this helpful?