login about faq

I get the following warning in Visual Studio 2013 when trying to use the Chilkat .NET assembly:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ChilkatDotNet45", "AMD64". 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.

asked Apr 23 '15 at 07:03

chilkat's gravatar image

chilkat ♦♦
11.8k316358420


The Chilkat .NET assembly is a mixed-mode assembly, meaning that it's a managed layer on the outside, but with a native inner-core (C++ compiled to native code). Therefore, it cannot exist as an "Any CPU" assembly and must exist in 32-bit or 64-bit form. In your C# application's project Properties, look at the options under the "Build" tab, as shown in the image below. When "Any CPU" is chosen, you will get the warning. The warning may be ignored if it's the case that when the application actually runs it has the correct 32-bit or 64-bit assembly to load.

You'll notice a "Prefer 32-bit" checkbox. This is checked by default. It means your application will always run as a 32-bit process, even on 64-bit machines. If this is the desired behavior, you may target the application for x86 (32-bit) because it will always be running as 32-bit anyway. You would reference the 32-bit Chilkat assembly, and there would be no warning.

Or you may uncheck "Prefer 32-bit", target x64, and reference the 64-bit Chilkat assembly. This would also eliminate the warning. Finally, you may keep "Any CPU" and ignore the warning -- just make sure that at runtime the correct matching DLL (32-bit or 64-bit) is present and loaded.

Also, see this for dynamically loading the correct .NET assembly at runtime: http://www.cknotes.com/dynamically-loading-net-assembly-32-bit-or-64-bit/

alt text

link

answered Apr 23 '15 at 07:20

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×2
×1
×1
×1

Asked: Apr 23 '15 at 07:03

Seen: 4,409 times

Last updated: Apr 23 '15 at 07:20

powered by OSQA