Click here to Skip to main content
13,507,571 members
Rate this:
Please Sign up or sign in to vote.
Im working in a new WebSite project. Im migrating a WinForm project to my new Asp.Net WebForm
The WinForm use a DLL(C++/CLI) as a reference and works fine

The problem is, when I try to use that DLL(C++/CLI) for my Website project, an error appears:
The located assembly's manifest definition does not match the assembly reference
(Excepción de HRESULT: 0x80131040)

I cannot Build the web site beacuse of that issure.

I have been lookinf that issure in the web but I cannot solved it
Im using:
Windows 7 64bits
Visual Studio Profesional 2010
The Winform project is Build on 32bits
The project that built the DLL(C++/CLI) is on Win32

I also tried to use REGSVR32 to add my DLL
Can you help me please

PD: Sorry for the bad english, I still learning
Posted 24-Feb-14 13:01pm
Sergey Alexandrovich Kryukov 24-Feb-14 21:09pm
This is unsolvable; you need to change your target architectures, on one or more projects. I answered, please see Solution 2.
Please don't post non-answers as "solution".
memd24 25-Feb-14 10:39am
Sry I forgot that Im using C# and Framework v4

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I don't see how you referenced the "DLL" (actually, the assembly, the notion of "DLL" is not essential in CLI), so I am not sure what's wrong.

I would advise to re-reference this assembly.

First, removed the reference. Then, make sure you add all inter-depending project in one solution. Now, you want to use you assembly in one or more projects. Add the reference, and, in the "Add Reference" Window, use, the "Projects" tab. This will take care of automatically correct assembly reference even if you change the project's properties.


I just noticed that one of the projects is compiled to 64-bit and another in 32-bit. This is impossible. You can never use assemblies compiled to different instruction-set architectures in one process.

First of all, there is no such thing as 64-bit architecture. It is either x86-64 or IE64 (Itanium), they are incompatible to each other, and each of them should be compatible with actual target CPU. Not so with x86. It is compatible with all architecture and uses WoW64 on 64-bit Windows:[^],[^],[^],[^].

What to do? First of all, I have no idea why do you compile project for concrete architecture. The very best "architecture" is "Any CPU". Use it in all cases, when you don't have very special reason to use the concrete architecture. (You only need to use concrete architecture is some native code is involved, for example, via P/Invoke). "Any CPU" is compatible with any of the concrete architecture, but two different concrete architectures cannot leave together, ever.

"Any CPU" is possible because .NET is based in JIT compilation. Your compilers produce IL code which is compiled to native instruction set during runtime:[^].

memd24 25-Feb-14 10:38am
Where did I said that one project is compiled to 64-bit? Both project are in 32bits
I tried using "Any CPU" for both project but nothing.
Also I referenced the project of the dll but the same issure
Sergey Alexandrovich Kryukov 25-Feb-14 11:35am
Right, you didn't. Sorry, I failed to get it. Then please use only the first part of my answer, before [EDIT].
memd24 25-Feb-14 14:54pm
Thanks for help me.
I added the project as a reference.
but a new issure replace the another:
Could not load file or assembly 'F3BC4DNI.DLL' or one of its dependencies. Can not find the specified module.
I guess because the Website cannot find de path of the dll from the c++ project
Sergey Alexandrovich Kryukov 25-Feb-14 16:32pm
It depends on where is that DLL. In GAC or not. How did you reference it?
memd24 28-Feb-14 12:31pm
I referenced it browsing the dll, I pastes the dll in the root of my project
Sergey Alexandrovich Kryukov 28-Feb-14 13:37pm
Do you mean "Add Reference" Window, "Browse" tab? If you added the reference, can you browse it in Visual Studio after you click on its node in Solution Explorer?
memd24 28-Feb-14 17:59pm
Yes, I added as a reference using the Browse button. Yes, I can se the reference in the reference folder

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180417.1 | Last Updated 25 Feb 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100