New Assembly, Sure-enough .NET (and Vice-Versa)
I typically urge that you establish and screen your assemblies against the same version of.NET that you will be playing them against. That way, you’ll have right references and deflect surprises from behavior differences between works up.
Sr. assembly, fresh.NET
But, sometimes you don'’t run against the same version that you built against. For example, the up-to-the-minutest uncommitted CLR is the default when interop dos it to be charged. Or, if the version of the CLR the assembly was built against is not uncommitted, the up-to-the-minutest version can besides be employed or else. If there is a compatibility problem with that for your application, you can push the use of a chosen CLR version by applying an app.config.
Compatibility
Yes, there are moving to be behavior differences between versions - no way around it. It is the.NET team’s goal to be as backward-compatible as realistically potential between versions. But, some changes are required - newfangled features are contributed which sometimes expect (hopefully minimum) behavior changes in other features. If we were required to ne’er give out any app, always, we wouldn’t be able-bodied to fixate any bugs or supply any features for fear that someone, someplace relyed on the conked out behavior in some unknown way. As Dll Hell has shown in the past, newfangled versions of components aren’t really compatible. The only ensured 100% compatible version is the same one you tested against.
V2+ assembly, elder.NET
Say you image a BadImageFormatException for hresult 0x80131107 (CLDB_E_FILE_OLDVER) with message “Version […] is not a compatible version.” That thinks that you’ve essayed to laden an assembly built against a newfangled version of the CLR than was campaigning.
This dies because newfangled files can’t be opened up on an sr. CLR that does not realize them. You will need to either utilize the v2 CLR to load up the v2/v1 assemblies, or load solely v1 assemblies on the v1 CLR. That’s just well practice, in any case. If you render to apply an elder.NET than you built against, a method you built against may not subsist, etc.
