I have ws2008 x64 with vs2008.
When I set my vs to x64 (because I have 64bit dlls) and run compilation sgen says that
An attempt was made to load an assembly with an incorrect format
VS takse sgen from
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\
and I think that it should take it from
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\x64\
when i take 64bit version of sgen and put it into C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ (replace 32bit version). I was able to compile.
What should I do to point to the correct version of sgen under vs.
Can I somehow configure solutinon platforms for one project to point to the correct sgens (for x86 to 32 bit and for x64 to 64 bit sgen version)?
This is the best answer I could find: Conditional Post-Build Event Command for x64 sgen, a blog post by Michael Hanes.
Use a post build event, that conditionally checks if the 64 bit SGEN is installed, and use it when needed:
This is intended to be a replacement for the “Generate Serialization Assemblies” dropdown setting for “On” for a given Visual Studio project.