Say I have 2 Winform projects A, B.
Project A (target .NET 2.0) has to be run on x86 (it is an external library) and for legacy reasons project B (target .NET 4.0) has
If any of your code calls 32-bit x86 libraries, the entire process needs to load as x86. No exceptions.
To do this, set the EXE project to x86, set DLL projects that have native x86 dependencies to x86, and for pure managed DLL projects you can use AnyCPU -- .NET will load them as x86 for your x86 EXE, but they can also load into x64 EXEs.
Remember that x86 code runs just fine on x64 processors running x64 Windows, with the help of the WOW64 compatibility layer.
(with limited exceptions: on Windows Server edition, WOW64 is an optional component, and in the preinstall environment there is no WOW64).