bardecode.com

  • Increase font size
  • Default font size
  • Decrease font size
Home FAQ How to Distribute SoftekBarcodeLib2.dll

How to Distribute SoftekBarcodeLib2.dll

For version 7.4.1 or later...

Please ensure that Visual C++ 2008 SP1 Redistributable Package is installed on any target system for this component.

There are separate versions of SoftekBarcodeLib2.dll for x86 and x64 based system, so care needs to be taken to ensure that applications reference the correct version in any given installation. There are two approaches that can be taken to using this component in Visual Basic .Net and Visual C# projects. In Visual C++ projects the x86 and x64 versions of the .net assembly may need to be switched manually.

Approach 1: Build for “Any CPU”

If you want to build your application for “Any CPU” and ensure that you reference the correct .net assembly on either an x86 or x64 based system then it is recommended that you do the following:

1. On an x86 based system install the x86 version of SoftekBarcodeLib2.dll in C:\windows\system32

2. On an x64 based system install the x86 version of SoftekBarcodeLib2.dll in C:\windows\SysWOW64 and the x64 version in C:\windows\system32

3. In your application, set the reference path to search c:\windows\SysNative first, followed by c:\windows\System32 second. This will ensure that the correct component is loaded for the correct architecture.

Approach 2: Build for “x86” or “x64”

This approach means that you need to target a specific architecture but has the advantage of working better with the publish wizard in visual studio.

1. Change the configuration for your project to either x86 or x64.

2. Add a reference to the appropriate version of SoftekBarcodeLib2.dll from the toolkit in either the x86 or x64 folders.

3. Close the project

4. Open the .vbproj or .csproj file with notepad, search for SoftekBarcodeLib2.dll and edit the HintPath, replacing x86 or x64 with $(Platform). 

Example change to HintPath:

Before:

<HintPath>..\..\x86\SoftekBarcodeLib2.dll</HintPath>

After:

<HintPath>..\..\$(Platform)\SoftekBarcodeLib2.dll</HintPath>

When you next open the project you should be able to switch between x86 and x64 targets and build/publish your application for either target.

For version 7.3.1 or earlier...

When distributing the SoftekBarcodeLib2.dll component you may find that you get an error message similar to the following:

System.IO.FileLoadException: Could not load file or assembly 'SoftekBarcodeLib2, Version=7.1.4.16, Culture=neutral, PublicKeyToken=3c09a6b205d2b618' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
File name: 'SoftekBarcodeLib2, Version=7.1.4.16, Culture=neutral, PublicKeyToken=3c09a6b205d2b618' ---> System.Runtime.InteropServices.COMException (0x800736B1): This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

The solution is to install the Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) either from the following link:

http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en

or include the Visual C++ run-time library files as a prerequisite when you publish your application.

You can also download and install one of the following ready made install sets, created from the Visual Studio publish wizard. This installs a simple demo application that uses the trial version of the SoftekBarcodeLib2.dll file.

Visual Studio 2008:

http://www.bardecode.com/downloads/SoftekBarcodeLib2Publish.zip

Visual Studio 2005

http://www.bardecode.com/downloads/SoftekBarcodeLib2Publish_vs2005.zip

Last Updated on Wednesday, 08 December 2010 12:11