Conditionally changing target framework version

后端 未结 1 641
甜味超标
甜味超标 2021-01-20 14:25

I\'m trying to compile an #ifdef\'d codebase to two different target frameworks, namely 3.5 and 4.0.

I attempted to modify the .proj files in the solution to no avai

相关标签:
1条回答
  • 2021-01-20 15:08

    Turns out the problem was twofold:

    • ReSharper (v7) making things harder by displaying compilation errors across different files, making it harder to realize that code actually compiled with conditional references. I think version 7 does not support manual project file changes, so an heads up to RS7 users.
    • VS2012 not changing the target framework in the UI (despite actually using the correct framework when compiling, as seen in the verbose output of MSBuild).

    I eventually managed to get the codebase to compile with a bit of patience. As per @granataCoder's suggestion, it's also better to keep different output paths (might be easy to overlook when dealing with orthogonal issues like conditional compilation).

    0 讨论(0)
提交回复
热议问题