ERRMSG: Could not transform licenses file ''licenses.licx'' into a binary resource


The full error message probably looks something like this:

Could not transform licenses file 'licenses.licx' into a binary resource.
 (1) : error LC0004 : Exception occurred creating type 'Atalasoft.Imaging.AtalasoftLicenseException'


Or

Could not transform licenses file 'licenses.licx' into a binary resource.
 (1) : error LC0004 : Exception occurred creating type 'System.ComponentModel.LicenseException'


Or

licenses.licx Could not transform licenses file 'licenses.licx' into a binary resource.
  (1) : error LC0004 : Exception occured creating type 'System.TypeInitializationException'

This compile error occurs when Visual Studio fails to embed a license file into the resource using a licenses.licx file. DotImage 2.1 and later will display a message box with details of the error. With DotImage 2.0 and older, you will need to remove or rename the licenses.licx file, and run your application for more details of the exception.

The reasons for this error are:

  • You are building a Web Application
    Solution: Web applications do not require the licenses.licx file, but sometimes visual studio will create it automatically, and since licenses.licx is related to embedding licensing in Windows Forms applications, it only causes trouble if used in class libraries or web applications.

    You can resolve the error by showing all files in the solution explorer, deleting the licenses.licx file, and rebuilding the solution.
  • A license file cannot be found
    Solution: Make sure the license file is in the correct place. By default this is "Program Files\Atalasoft\DotImage x.x\Bin". If the dotImage assemblies are being intentionally loaded from some place other than this, then copy the license files there. Otherwise, fix the references.
  • An invalid or corrupt license file
    Solution: Request a new license file using your serial number, if this does not work, please contact Atalasoft.
  • An assembly version mismatch
    Solution: All of the Atalasoft assemblies must be the exact same version, check to make sure this is the case.
  • Incorrect or misspelled entry in the licenses.licx file
    Solution: Review the licenses.licx file and see which entry is incorrect.

Original Article:

Q10104 - ERRMSG: Could not transform licenses file ''licenses.licx'' into a binary resource.