Is it really important to specify architecture type if I'm making a simple Windows program that utilizes HttpWebRequests, or is it ok to leave it as "Any CPU"?
Asked
Active
Viewed 233 times
2 Answers
6
Any CPU means the .NET framework just-in-time (JIT) compiler will compile your intermediate language (IL) to either x86 or x64 at runtime on the client machine, based on its architecture. If you are not linking to any DLLs that are specifically either x86 or x64, then you are safe to (and should) leave the configuration as Any CPU.

Timothy Shields
- 75,459
- 18
- 120
- 173
-
Realized after writing that this definitely has an answer already... – Timothy Shields Feb 16 '14 at 08:11
2
In most cases, you can leave it as "Any CPU". I personally only change it when there is explicit need such as,
- When you have unmanaged references that don't work well with x64.
- When you are compiling DLL that you want to enforce specific architecture instead of inheriting from loading process.
- When you know your program would need lots of memory and you want to enforce x64.
- You are making direct calls to x64 Windows APIs.
- If your application has sensitive data and you need through security review.

Shital Shah
- 63,284
- 17
- 238
- 185
-
Someone with more knowledge should weigh in, but my understanding of the concept of hardening makes me believe that you shouldn't use AnyCPU for security-sensitive applications. However, for a "simple windows program", this is most likely not relevant. – Skeleton Feb 21 '20 at 08:07