LogoLogo
HomeNewsSupportVideos
  • Introduction
  • Getting Started
  • What's new in 4.0
    • Known Issues
    • .NET Core Designer
    • Managed Graphics
    • Fluent Markup
    • Markdown Support
    • Upgrade from 3.x
  • Releases
    • What's new in 4.0
    • What's new in 3.5
    • What's new in 3.2
      • View Builder
      • Validation Rules
      • Enhanced Font Support
      • Design-Time Debug
    • What's new in 3.1
    • What's new in 3.0
      • FAQs
      • Update Existing Projects
      • Multi Targeting
      • Visual Studio Designer
      • Referencing Assemblies
      • Docker Support
      • Troubleshooting
      • Deployment
    • What's new in 2.5
    • What's new in 2.2
    • What's new in 2.1
    • What's new in 2.0
    • Upgrade from 1.x
  • Getting Started
    • New Project
    • Templates
    • Troubleshooting
    • License Activation
    • FAQ
    • API
    • Hybrid
    • Deployment
    • Theme Builder
  • Concepts
    • Startup
    • Configuration
    • Load Balancing
    • Designer
    • Layouts
    • Client Profiles
    • Tab Order
    • Compression
    • Embedded Resources
    • Modal Workflow
    • Localization
    • RightToLeft
    • Background Tasks
    • Real Time Web Applications
    • JavaScript
    • JavaScript Object Model
    • Security
    • Synchronization
    • Session Management
    • Theming
    • Dependency Injection
    • Application Switches
    • Visual Studio Code
  • Controls & Components
    • General
      • Application
      • AutoSizing
      • AutoScroll
      • AutoScaling
      • Accessibility
      • Colors & Fonts
      • Embedded Tools
      • Events
      • Touch Events
      • Images
      • Labels
      • ToolTips
      • Data Binding
      • Common Properties
      • Custom Painting
      • Move & Resize
      • Drag & Drop
      • Validation
      • User Data
      • Responsive Properties
      • VB.NET Extensions
    • Common Dialogs
      • FolderBrowserDialog
      • ColorDialog
      • OpenFileDialog
      • SaveFileDialog
    • Editors
      • TextBox
        • TagTextBox
        • MaskedTextBox
        • TypedTextBox
      • DateTimePicker
      • MonthCalendar
      • TimeUpDown
      • DomainUpDown
      • NumericUpDown
      • TrackBar
    • Buttons
      • Button
      • SplitButton
      • CheckBox
      • RadioButton
    • Containers
      • Page
      • Form
      • Desktop
      • Panel
      • FlexLayoutPanel
      • FlowLayoutPanel
      • TableLayoutPanel
      • GroupBox
      • Accordion
      • TabControl
      • UserPopup
      • UserControl
      • ToolBar
      • StatusBar
      • SplitContainer
      • SlideBar
    • Lists & Grids
      • ComboBox
        • UserComboBox
        • TreeViewComboBox
        • ListViewComboBox
      • ListBox
        • CheckedListBox
      • TreeView
      • ListView
      • DataGridView
        • Column
        • TextBoxColumn
        • ButtonColumn
        • LinkColumn
        • ImageColumn
        • MaskedTextBoxColumn
        • DateTimePickerColumn
        • NumericUpDownColumn
        • CheckBoxColumn
        • ComboBoxColumn
      • DataRepeater
      • PropertyGrid
    • Extenders
      • Animation
      • ToolTip
      • ErrorProvider
      • Rotation
      • StyleSheet
      • JavaScript
    • Media
      • Audio
      • Video
      • FlashPlayer
    • Content
      • Label
      • LinkLabel
      • PictureBox
      • ScrollBars
      • Upload
      • AspNetPanel
      • ImageList
      • PdfViewer
      • ProgressBar
      • Spacer
      • Widget
      • WebBrowser
      • IFramePanel
      • HtmlPanel
      • Canvas
      • Shape
      • Line
    • Menus
      • MainMenu
      • MenuBar
      • MenuItem
      • LinkMenuItem
      • ContextMenu
    • Notifications
      • AlertBox
      • MessageBox
      • Toast
    • Other Components
      • Timer
      • BindingSource
      • BindingNavigator
      • DataSet
      • EventLog
      • MessageQueue
      • PerformanceCounter
Powered by GitBook
On this page
  • Collection Editors
  • Data Binding
  • BinaryFormatter and .NET 9
  • System.Runtime.CompilerServices.Unsafe Hell

Was this helpful?

Export as PDF
  1. What's new in 4.0

Known Issues

PreviousWhat's new in 4.0Next.NET Core Designer

Last updated 22 days ago

Was this helpful?

Collection Editors

Editors, especially collection editors, present the most significant challenges when migrating to the out-of-process designer. As of now, we have integrated the following collection editors using the basic editor system that comes with the designer. However, we are planning to transition the more complex editors in an upcoming release.

  • DataGridView columns editor

  • TreeControl nodes editor

  • Menu items editor

Data Binding

Data binding and the associated editors function as expected. However, it's worth noting that Microsoft has not yet provided an implementation for the typed DataSet editor. Currently, Microsoft suggests using the new Object Data Source Binding as an alternative to accommodate this gap.

BinaryFormatter and .NET 9

If you prefer to use .NET 9 or .NET 10 instead of .NET 8, you can do so with minimal issues. However, it's important to note that with .NET 9, Microsoft has completely removed the BinaryFormatter, as part of their ongoing initiative to improve developer security by protecting them from themselves.

Interestingly, they have reintroduced the same "unsafe" classes by offering them as a NuGet package.

This change affects all designer .resx files that contain values serialized with the BinaryFormatter. While these files are safe as internal .resx files — something even Microsoft acknowledges — they will not load properly in .NET 9 and above unless you include the following NuGet package reference in your project:

<PackageReference 
    Include="System.Runtime.Serialization.Formatters" 
    Version="9.0.0-*" />

In version 4.0.1 of Wisej.NET, we have completely eliminated the use of binary serialization. While you still require the System.Runtime.Serialization.Formatters package to open existing designer files that contain Responsive Profiles and Snap Lines, the binary serialization will not be used when saving these files.

Once you have transitioned all existing binary resources to the new format, you can safely remove the System.Runtime.Serialization.Formatters package from your project dependencies.

System.Runtime.CompilerServices.Unsafe Hell

The System.Runtime.CompilerServices.Unsafe assembly is known for potentially causing versioning conflicts when used in conjunction with the .NET Framework. In our latest System.Drawing.Managed library, designed for net48, we rely on System.Memory version 4.5.5, which consequently depends on System.Runtime.CompilerServices.Unsafe version 4.5.3. However, issues arise when other third-party libraries reference differing versions of this assembly. This often leads to the familiar error message: "Could not load file or assembly or one of its dependencies. The located assembly's manifest definition does not match the assembly reference." Attempting to resolve one conflicting reference may inadvertently cause issues with another, resulting in a complex chain of version conflicts.

This versioning issue primarily occurs with the .NET Framework. Unlike .NET Core which handles dependencies differently.

If you have the ability to modify the imported package, it is advisable to align its version with the one utilized in System.Drawing.Managed. However, if changing the package version is not an option, you can address the version conflict by using the web.config file to redirect the assembly version. Here is an example of how you can accomplish this:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-9.9.9.9" newVersion="4.5.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Ensure you use the correct publicKeyToken with the actual public key token of the assembly. This configuration will redirect calls to different versions of System.Runtime.CompilerServices.Unsafe to the specific version (4.5.3 in this example) that is compatible with System.Drawing.Managed.

Databinding with the OOP Windows Forms Designer - .NET Blog.NET Blog
Logo