Is it discoverable, at runtime, which .NET Framework version was targeted by my own compile? The environment in which I am writing allows me to write C# that is compiled on another machine, but I do not know which language version is available, other than it is 2.0 CLR. I'd like to write a test that is output to the log file indicating the targeted framework.
For this to work, I'd guess the compiled assembly would have to carry that information.
This question is NOT how to list all frameworks on the runtime machine, as all versions to current are installed. This is not a duplicate of that question. This is also not a duplicate of how to determine the CLR with System.Environment.Version. I'm also not trying to detect at compile time the target .NET runtime. This needs to be a runtime detection so I can send it to the log.