How can i get the version of the .NET Framework i am targeting, rather than the version of the .NET framework the app is currently running under?
For example, if the application targets .NET Framework 4.5, i would need to know that i am targeting .NET Framework 4.5.
For example, checking System.Environment.Version
:
- when targeting .NET Framework 4:
4.0.30319.18502
- when targeting .NET Framework 4.5:
4.0.30319.18502
So that doesn't work.
The real goal is to try to work around the lack of compiler defines in .NET.