I have an assembly. Is there a way to detect which version of .NET was used to build that assembly?
You could possibly use Assembly.ImageRuntimeVersion. According to the MSDN docs, by default this is set to the version of the CLR used to build the assembly. Though apparently it can be changed.
It is a string property, so you would have to do some string comparison on it.