I am looking for advice for the best way to set up a new VS2012 C# project. I want to target both x86 and x64 architectures. However, I have 3rd Party DLLs that I must reference. There are two versions of the same DLL provided; one compiled for x86 and x64. That being said, do I need to target x86 and x64 specifically? I wouldn't think that AnyCPU or the new AnyCPU32bitpreferred would work for my situation. Also, what's the correct way to reference the DLLs in the same project (they have the same name but one is 32-bit and the other is 64-bit). Thank you.
VS2012 Choosing between x86, x64, AnyCPU, AnyCPU32bitpreferred and Referencing 3rd Party DLLs
646 Views Asked by bbs_chad At
1
There are 1 best solutions below
Related Questions in VISUAL-STUDIO-2012
- An error occurred while trying to restore packages: 'Dapper' already has a dependency defined for 'System.Data.SqlClient'
- Getting Error 0x80131509 whenever I try to create a new empty project (using vs2012 as it's what my uni prefers)
- Visual Basic Supports
- Open Visual Studio 2012 solution in Visual Studio 2013
- Gif is Slow in Visual Studio C# Winform Application?
- The type initializer for 'Sybase.Data.AseClient1.AseConnection' threw an exception. SSIS - Sybase
- Is there a way to fix broken syntax highlighting in Visual Studio 2012?
- Visual Studio Ultimate
- Can __uuidof be used as a C-string const?
- How to connect MS Access database to Visual Basic
- Cannot drag and drop items from toolbox in Visual studio
- Invalid operation. Could not find default endpoint element
- I keep on receiving a "bash permission denied" notification every time I try to execute a program on VS Code
- Wix Toolset v4 Shortcut & installation directory per login user
- Migrating from VS2012: Opening in VS2022 does not prompt for upgrade
Related Questions in X86
- How to call a C language function from x86 assembly code?
- the difference between two style of inline ASM
- Understanding the differences between mov and lea instructions in x86 assembly
- ARM Assembly code is not executing in Vitis IDE
- x86 - compare numbers and push the result onto the stack
- Seeking for the the method for adding the DL (data register) value to DX register
- link.exe unresolved external symbol _mainCRTStartup
- x86 Wrote a boot loader that prints a message to the screen but the characters are completely different to what I expected
- How does CPU tell between MMIO(Memory Mapped IO) and normal memory access in x86 architecture
- Why do register arg values need to be re-assigned in NASM after an int 0x80 system call?
- Why does LLVM-MCA measure an execution stall?
- Why does shr eax, 32 not do anything?
- Evaluating this in Assembly (A % B) % (C % D)
- Understanding throughput of simd sum implementation x86
- Making portable execution errors
Related Questions in 64-BIT
- GDI - Why the printing StartPage() function works in 32 bit but raises an exception in 64 bit?
- GNU AS ASM to bytecode dump
- How do I use .lib to compile and link in c++ builder 11.3 windows 64bits platform?
- Windows 64-bit: Do overlapped MMF windows mean more RAM consumption (doubling the RAM where the file views overlap)?
- Invoke jar from C++ using JNI
- SQLBindCol for long integer value on 64Bit platform?
- Assembly segmentation fault in example code
- PowerShell switch block and values coded in 64 bits
- How can I get a 32-bit output with Python on a 64-bit system?
- Recompiled APK throws error "This release is not compliant with the Google Play 64-bit requirement"
- Porting code that wraps ODBC API to 64 bit questions
- ilink64 Error Fatal: Unable to open file 'VCL.VIRTUALIMAGELIST.O'
- Open and write file in nasm for Windows 64bit
- C display tansparent text on any background
- Problem with quicksort function on arrays of 64 bits integers in C
Related Questions in ANYCPU
- BadImageFormatException with AnyCPU build
- How to handle C# Third Party DLLs with Any CPU & Prefer 32-bit?
- A 32 bit processes cannot access modules of 64 bit process
- Reference for .NET-Application has different files for x86 and x64 - how load the correct version at runtime?
- Overflow operation when compiling using AnyCPU
- C#: Configuring a project for x64 platform in AnyCPU codebase
- CefSharp AnyCPU Support (Option 4)
- How do you build a azure devops pipeline with mixed platform
- How to publish net core project to AnyCPU?
- .NET Core 3.1 Console App will not run on Windows 7
- Including 64 bit-only assemblies in a WinForms project
- .NET Windows API call issue in a 64-bit process only
- Sentinel HASP returns NoApiDylib for 64bit DLL
- This 64-bit process failed to load the library R.dll. Native error message is 'The operation completed successfully'
- MSBuild: Avoiding repeatedly building Any CPU project references
Related Questions in DLL-REFERENCE
- How to add vb.net4 dll in ASP.NET Core 6 Web API project and how to configure the appsetiings to establish the connection string
- Using a C++ library from C# and linking them in the same solution
- Dynamic-Link Library .Net ignore reference Path
- How to add reference to other project's .lib stub
- DLL dependency from different installation folder not found in ASP.NET website
- Can I specify the absolute location for <entityFramework>.<providers>.<provider> in App.config
- C# Referencing dll in subfolder
- Is there a way in C# to restrict call to indirect referenced library/DLL?
- Version Independent reference in C# Class Library
- Why is this NuGet dependency missing when compiling .NET Framework project depending on .NET Standard?
- How do I know which Platform Extensions do I need for .NET Standard?
- Unable to reference dll included in a Nuget Package
- How to use a 3rd party DLL in a C++ DLL project?
- 'Could not load file or assembly', dll reference asp.net core 2 application
- Xamarin Studio could not reference .dll file
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your Project setup should be focussed on the "target" computer, not on compilation computer. If your target system will be 32bits, then you should reference the x86 version of the 3rd party libraries, in other way if your target computer will be 64bits then you should reference the x64 version. You shouldn't/couldn't reference to both libraries into the same Project. In any case you could mantain two parallel versions of your Project which differs just in references section. If you need to create x64 installers then you probably also would check the answer of this question: BadImageFormatException x64 Issue
AnyCPU could be useful when you don't redistribute the 3rd party DLLs, and you asume they were previouly installed on target system, and your development don't need/use any special feature of x64 set. In this case, your code will invoque the 3rd party DLL in the format they were installed.