Timeline for answer to How do I fix the Visual Studio compile error, "mismatch between processor architecture"? by Gustavo Mori
Current License: CC BY-SA 3.0
Post Revisions
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 7, 2018 at 0:48 | comment | added | David Burg | While Gustavo's rule is a good principle, it cannot be used for the specific problem asked in this question as the project already has a dependency on a 3rd party assembly that didn't follow the rule (it's x86, not AnyCPU). Hence as long as the dependency is there the whole chain of projects must target x86 and nothing else. | |
| Aug 20, 2015 at 22:39 | history | edited | Gustavo Mori | CC BY-SA 3.0 |
added 438 characters in body
|
| Aug 20, 2015 at 22:30 | comment | added | Gustavo Mori | Because of the dependency on Native.dll, your entire app/assembly lineage is now x64, whether your suppress the warning or not. While suppression works in your scenario, weird situations could arise in the future. For example, 1) assembly NetB is used in an x86 environment, where Nativex64 will not load, or 2) your customer wants an x86 version of App1.exe, and you compile happily, since NetB is marked as any CPU, but again, Nativex64 at the top of the stack will not load | |
| Jun 29, 2015 at 19:00 | comment | added | Steve Robbins | This rule makes sense to me. But consider the following situation: Native.dll (x64) used by NetA.dll (Any CPU) used by NetB.dll (Any CPU) used by App1.exe (x64). There is no real problem here, but compiling NetA.dll gives me the warning. OK, since this assembly directly depends on Native.dll, I could mark it as x64 also. But then compiling NetB.dll complains. I want to keep NetB.dll as "Any CPU" because it is a common assembly used in a different, pure-dot-net application. I conclude that my only option is to suppress/ignore the warning. Yes? | |
| Dec 13, 2012 at 1:42 | history | edited | Mark Richman | CC BY-SA 3.0 |
Changed "86-bit" typo to "32-bit".
|
| Nov 13, 2012 at 23:19 | history | answered | Gustavo Mori | CC BY-SA 3.0 |