The purpose of this page is to explain how to compile an UltraLite.NET application under 32-bit and get it to run under x64 OS.
- SQL Anywhere 10.x or later
- Visual Studio 2005 or later
- .NET 2.0 or later
By default, when creating a new project in Visual Studio, the project properties for hte platform target is automatically set to "Any CPU".
Running the application under x64 and because the platform target was set to "Any CPU", the .NET x64 framework is loaded and requests the ULNET .DLL file to be x64 as well. This causes the application to fail because Ultralite does not ship an x64 version of the ULNET .DLL file.
To resolve this issue, we need to make sure Visual Studio always compiles the application as x86.
- Open your Visual Studio UltraLite.NET project.
- Click on the project menu and select your project properties. (i.e. win32sample properties...)
- You will see the following screen:
- Click on Build on the left-hand side. You should see the following screen:
- Notice the Platform target is set to Any CPU. Click on the dropdown list and select x86.
- Now compile your project.
- Test your application
Note that if you are compiling the project from the command line, you need to add the following to your command: