TX Text Control Blog

Windows Forms with TX Text Control .NET on 64-bit CPUs

Blogged by Gunnar Giffey on August 15, 2006 and tagged with 64bit, .net, servertextcontrol.

Recently, we have received several support requests about deploying TX Text Control on 64-bit machines running Windows XP Professional x64 Edition. If an application, which contains TX Text Control, is run on a 64-bit machine, the application crashes with the error:

System.DllNotFoundException. The Text Control kernel DLL file could not be found.

This happens because the application is launched in 64-bit mode by default. TX Text Control is a 32-bit component.

To get a 32-bit application working, you will need to set the platform target property to x86. This has been defaulted by Microsoft in VS2005 to AnyCPU.

Unfortunately, there are two different methods of doing this, depending on your Visual Studio 2005 edition:

VS2005 Express

The VB and C# Express products do not expose the Target property inside the development environment. You will need to carefully modify the project file using a text or an XML editor.

  1. Close the project and/or solution
  2. Select Open File from the File menu
  3. Navigate to the project directory, and highlight the project file
  4. Press the Open button to open the project file in the XML editor

Locate the first <PropertyGroup> tag and add the following line:

<PlatformTarget>x86</PlatformTarget>

Once you have done that, simply follow this steps:

  1. Save the project file
  2. Reopen the project and/or solution using Open Project/Solution from the File menu
  3. Continue with development, debugging, and testing

Visual Studio 2005 Standard, Professional and Team System Editions

C# Projects

  1. Right click the project in the solution explorer and open properties
  2. Choose the Build tab
  3. Set the Platform Target property to x86

Visual Basic Projects

  1. Right click the project in the solution explorer and open properties
  2. Choose the Compile tab
  3. Press the Advanced Compile Options button
  4. Set the Target CPU property to x86
 
 
User Contributed Note

User Contributed Note by Mick Casper on February 22, 2007 at 4:49:18 PM CET

Still won't build :( I have followed your steps here on a very simple test project, and I still cannot get this to build. Any suggestions?
User Contributed Note

User Contributed Note by ATon October 19, 2007 at 12:39:32 PM CEST

I too have followed the instructions on a 64bit Windows Server 2003R2 x64 Edition - and I cant load any screen with a Text Control in it on. My application runs fine in all other respects.
User Contributed Note

User Contributed Note by Adam Toth on October 19, 2007 at 2:45:57 PM CEST

I have it working now but you need to take one further step - selecting 32-bit instead of AnyCPU in the target drop-down will not change all of the flags that must be changed to force 32-bit execution. You need to use corflags.exe from the SDK and set 32BIT+ and ILONLY- on your assembly (http://msdn2.microsoft.com/en-us/library/ms164699(VS.80).aspx) eg corflags myExe.exe /32BIT+ /ILONLY- Adam
User Contributed Note

User Contributed Note by Matt Phillips on September 25, 2009 at 12:59:39 AM CEST

Is this going to preclude my application from running on 64-bit systems? Or does it just force the application to run in a 32 bit mode?
User Contributed Note

User Contributed Note by Gunnar Giffey on September 25, 2009 at 2:40:27 PM CEST

Matt, The application will run on the 64-bit OS, but in 32-bit mode.