Archived Forum Post

Index of archived forum posts

Question:

Chilkat .NET Component Downloads error

Nov 17 '14 at 09:43

I am using VS 2013 and .NET Framework 3.5

I tried the two packages from NuGet but both give a warning and i cant use it.

Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ChilkatDotNet2, Version=9.5.0.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. E-Line Support Client

Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ChilkatDotNet2, Version=9.5.0.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd, processorArchitecture=AMD64", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. E-Line Support Client

Is there any solution for this?


Accepted Answer

It's only a warning that means when you deploy your app, you must be sure that the 32-bit Chilkat assembly is loaded when your application runs as a 32-bit process (which is always the case on a 32-bit machine, and would be the case for 64-bit machines if you explicitly target 32-bit). If your application runs as a 64-bit process, you must be sure that the 64-bit Chilkat assembly is loaded at runtime. Otherwise you'd get the "incorrect format" error.

The Chilkat .NET assembly is a mixed-mode assembly. Because it's written in C++, the inner-core compiles to native code. The outer layer is managed. Therefore, the assembly itself cannot be "Any CPU".

Two possible choices are:

1) Target your app for 32-bit, which allows you to use the 32-bit assembly on any type of system.

or

2) Target your app for "Any CPU". In this case you'll need to deploy the Chilkat assembly that matches the computer architecture. You don't need separate builds of your app, just copy the correct Chilkat DLL with the app.

Chilkat also offers a download for Mono to support .NET cross-platform. This implementation provides a pure / managed .NET assembly, which can be reference by an app w/ "Any CPU" as the targeted architecture. However, it will also come with a "functional" DLL/shared-lib (meaning function-based instead of object-oriented class-based) that would need to be distributed alongside the Chilkat Mono assembly. The Chilkat Mono implementation provides a single API for platforms including MAC OS X, Linux, Windows, Android, and iOS.