Any CPU is a build target for .net Applications which are compiled using the Visual-Studio IDE
Questions tagged [anycpu]
97 questions
80
votes
2 answers
C# compiling for 32/64 bit, or for 'Any CPU'?
Possible Duplicate:
What does the Visual Studio "Any CPU" target mean?
I've noticed that when compiling C# code in Visual Studio, there are typically options for compiling for 32/64 bit systems, and there's also one for compiling for Any…

helloworld922
- 10,801
- 5
- 48
- 85
32
votes
2 answers
Using devenv.exe from the command line and specifying the platform
I'm attempting to compile a visual studio solution using devenv.exe from the command line. I can get it to work but all the projects in the solution are compiled for AnyCPU and I want them to be compiled for x86. Both the debug and release…

user2687412
- 353
- 1
- 3
- 6
29
votes
4 answers
Change target CPU settings in Visual Studio 2010 Express
I wish to change the target CPU settings from "Any CPU" to "x86" in Visual Studio 2010.
I read on another website that I need to do the following:
Go to the startup project of your program.
Open the properties window.
Click the compile tab.
Click…

Shrayas
- 6,784
- 11
- 37
- 54
20
votes
1 answer
Odd debugger behavior with Interface and Generics on 64bit OS when toggling 'Prefer 32-Bit
I have come across this odd behaviour: when my projects settings are set to Any CPU and Prefer 32-bit on a 64bit Windows 7 OS the .Net 4.5program below works as expected. If however I turn off Prefer 32-bit then when stepping through the program, I…

Stephen Bailey
- 1,931
- 13
- 20
18
votes
2 answers
Any CPU not available in C++/C# solution
I have a solution that contains C# and managed C++ projects.
It compiles in the solution platform x64 and x86. Since it is managed C++ I wanted to create a 'Any CPU' solution and get rid of the old ones.
I changed the C++ project linker settings to…

Frank Kaaijk
- 293
- 1
- 3
- 12
16
votes
2 answers
How to add x64 (or Any CPU) as a build option in Visual Studio 2010 (from console application to class library)
Initially, I created a console application using Mass Transit as my service bus. Recently, I switched to NServiceBus, which doesn't require you to make a console application, but a class library instead. In the project properties, I simply switched…

Ryan Hayes
- 5,290
- 4
- 42
- 52
15
votes
1 answer
Why is an 'Any CPU' application running as x86 on a x64 machine?
I have a Any CPU application installed to Program Files (x86). On one Windows 7 x64 machine, it runs as x64 as expected while on another Windows 7 x64 machine, it runs as x86!
How can this be? I expected it to run as x64 on both machines. What might…

BobbyHill
- 151
- 1
- 3
13
votes
3 answers
I do not have a 'Any CPU' option present in my Configuration Manager
I have read several posts about the configuration manager in VS2010 (or before) but I can not find my problem.
I have a solution containing 6 projects.
When I open the Configuration manager, I can select:
'Active Solution Configuration' with values…

Michel Keijzers
- 15,025
- 28
- 93
- 119
11
votes
2 answers
Why is my application, which I compiled with Any CPU, running as a 32-bit process on my 64-bit machine?
Why is my application, which I compiled with AnyCPU, running as a 32-bit process on my 64-bit machine, and therefore unable to interact with Notepad, which is running as a 64-bit process?
I have the following code which will not run on x64 Operating…

Peyman
- 3,059
- 1
- 33
- 68
8
votes
2 answers
c# visual studio build exe with target anycpu but that determines its platform(x86/x64) on the calling process platform(x86/x64)
We have a software in 32 and 64 bits that calls our exe and passes events to it(like a plugin).
The thing is that our exe has to execute in the same bitness(x86/x64) as the calling software (if the software is run in 32 bits version our exe must run…

VSP
- 2,367
- 8
- 38
- 59
8
votes
2 answers
Managed C++ and AnyCPU
I have a Managed C++ dll that I am referencing from a C# project. The C# project will be compiled as AnyCPU. Is there any way to compile a 32-bit and 64-bit version of the Managed C++ dll and then tell the C# project at runtime to load the correct…

Dirk Dastardly
- 1,017
- 2
- 12
- 23
6
votes
1 answer
How can I change the Build.Platform property in a Visual Studio project?
One of the many projects in a very large solution somehow became set to Build Platform == Active (x86). I want it to match all of the other projects ("Any CPU").
I successfully changed the Platform target dropdown from "Active (x86)" to "Any CPU",…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
5
votes
2 answers
.Net2 assemblies hosted in .Net4 app perform better in x86 than in AnyCpu mode?
I have a .Net4 WinForms app that references 3rd party .Net2 assemblies, which contain graphics-heavy visual controls. I've noticed a huge improvement in app's visual performance when I accidentally switched it from AnyCpu to x86 compilation mode. My…

Boris B.
- 4,933
- 1
- 28
- 59
5
votes
1 answer
When it's needed to use x86 or x64 target platform?
I've studied the information about building apps with a different target platforms options in visual studio, but I still can't understand the following things:
when do we need to set x86 or x64 target?
what advantages gives us setting a specific…

user1178399
- 1,028
- 8
- 17
- 32
5
votes
1 answer
Using devenv.exe from the command line and open a Solution
I've configured my VSIX-Project to run devenv.exe when I press F5.
This opens the start page from Visual Studio. In order to test my extension I have to manually open a specific solution.
I tried to run devenv with the argument '/Run…

Djeurissen
- 377
- 5
- 15