Search

Atalasoft Knowledge Base

ERRMSG: BinaryFormatter serialization and deserialization are disabled within this application

Tananda
DotImage

CRITICAL NOTE:: ARTICLE APPLIES ONLY TO 11.5.0.6 and OLDER 

DotImage Removed our hard dependency on BinaryFormatter in 11.5.0.7, thus making this article somewhat obsolete. If for some reason, you're still using an older version than 11.5.0.7, this may still apply, but the true fix is to upgrade to at least 11.5.0.7 (11.5.0.10 is the final 11.5 version, 2026.2 and up support .NET 10+).

NOTE that version 2026.2. dropped support for .NET 9 and under. If you're using .NET6-8, you'll need to stick with 11.5
(see FAQ: Support for ASP.NET Core / .NET Core / .NET 5 / 6 / 7 / 8 / 9 / 10+)

LEGACY ARTICLE (Applies only to 11.5.0.6 and older) 

Error:

Some users in .NET 8 with locked down settings are getting the following exception:

BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.

stack trace:

at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at Atalasoft.Licensing.AtalaLicenseContext.Deserialize(Stream o, String cryptoKey, AtalaLicenseContext context)
at Atalasoft.Licensing.AtalaLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly)
at Atalasoft.Licensing.AtalaLicenseProvider.xl2H2YtVq(String , Type , LicenseContext , String& , Boolean& , Boolean& , String& , Boolean , Boolean )
at Atalasoft.Licensing.AtalaLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.IsValid(Type type, Object instance, License& license)
at Atalasoft.Imaging.AtalaImage.ValidateLicense()
at Atalasoft.Licensing.AtalaLicenseHelpers.SetLicenseShared(Action validationMethod)
at Atalasoft.Imaging.AtalaImage.SetLicense()
at Atalasoft.Imaging.AtalaImage..ctor()
at Atalasoft.Imaging.ImageSource..ctor()
at Atalasoft.Imaging.RandomAccessImageSource..ctor()
at Atalasoft.Imaging.FileSystemImageSource..ctor(String path, String pattern, Boolean doAllFrames)
at Atalasoft.Imaging.FileSystemImageSource..ctor(String path, Boolean doAllFrames)

Fix:

 If your application / environment disables BinaryFormatter for security reasons - it must be enabled or you won't be able to use DotImage

Also please ensure your CSPROJ/VBPROJ have

<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>

Last Update

2026-08-27 - TD
Details
Last Modified: Last Month
Last Modified By: Tananda
Type: ERRMSG
Article not rated yet.
Article has been viewed 2.1K times.
Options
Also In This Category