Importing of types across .NET versions is allowed #78
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If a type (in an assembly built on .NET 2.0) is imported in MainModule (assembly built on .NET 3.5), then it imports successfully.
This should not be case. While importing the Type it should check if the .NET runtime/CLR version match else it will result in "bad image format"
No it doesn't. That's a valid use case, and you can often find assemblies which reference different versions of .net assemblies.
That's correct only if the CLR version is same. Importing higher version of CLR into an assembly with lower version of CLR will not work.
Example, .NET 4.0 type imported in .NET 3.5 will not work. However, Mono allows that and creates a Bad Image assembly.
A .net 2.0 type will work perfectly in a .net 4.0 assembly. Cecil doesn't verify the validness of the metadata anyway, you might very well emit this kind of code for a test scenario.