SQL Comparison SDK
Latest version: 10.0
Knowledge Base
Licenses.licx is not a valid Win32 application
Category: Troubleshooting & error messages
Date: 20 May 2009
Product: SQL Comparison SDK
Versions: 3,4,5,6,7.1*
Platform: 64-bit editions of Windows
Fix version: SDK 7.0 assemblies are compiled as "Any CPU" and should not encounter this issue
When compiling a Toolkit application in Visual Studio 2005 on a 64-bit operating system, a BadImageFormatException is thrown indicating that Licenses.licx is not a valid Win32 application.
The root of the issue is that the licence compiler (lc.exe) that is part of the Framework comes in a 32-bit and a 64-bit version. When compiling a Toolkit application on a 64-bit OS, the 64-bit lc.exe is invoked, leading to the exception message.
You can work around this by setting pre and post-build events to control the compilation of the licence. This, in addition to choosing the target CPU as 32-bit, will allow your project to compile and licence successfully. In VS 2005, right-click the project and select properties. Next, click 'Build Events'.
Set a new pre-build event:
c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe setwow
Set a new post-build event:
c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64 set64
Note that the paths may differ based on the installation folder of your .NET Framework.
*NB this error will also happen in version 7.1, but only when RedGate.BackupReader.dll is used. This DLL will only run properly in a 32-bit environment, so referencing this DLL in your project will require you to compile it specifically for x86.
Document ID: KB200701000007 Keywords: BadImageFormatException,"Not a Valid Win32 application"
Was this article helpful?
SQL Comparison SDK
- Licenses.licx is not a valid Win32 application
- Application licensing invalidated by renaming assembly
- Excluding a table from a data comparison
- Manually licensing Red Gate assemblies
- RedGate.Licensing.Helper.dll is attempting managed execution inside OS Loader lock
- Troubleshooting SQL Comparison SDK licensing
- SQL Compare synchronization error 'Full-Text Search is not installed'
- Using SQL Data Compare mappings in projects using the API
- Licensing automated builds with NAnt
- Licensing ASP .NET applications
- Running SQL code inside SQL Comparison SDK applications
- Creating an HTML report of schema differences in C#
- Creating a synchronization script without batch markers
- Creating an HTML report of schema differences in Visual Basic .NET
- SQL Toolkit has become SQL Comparison SDK
- SQL Comparison SDK column mapping
- Executing your own SQL queries together with SDK synchronization
- Error 1603 occurring during installation
- Licensing SDK applications in Visual Studio 2010
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Comparison SDK
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Licensing and distribution