You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NET8 breaking change due to TypeForwardedTo attribute missing for PEFileKinds #90578
We're trying to upgrade our project from NET Framework to NET8. First, we've upgraded it to NET6 where it is mostly working, then we are trying to update to NET8. After upgrading, we are getting an exception:
System.TypeLoadException: 'Could not load type 'System.Reflection.Emit.PEFileKinds' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'
After some investigation, it looks like NET8 version of the mscorlib is missing [assembly: TypeForwardedTo(typeof(PEFileKinds))] along with some other types:
@jimm98y actually here's a follow-up question. As some/all of these type are just stubs on .NETCoreApp and don't do anything, can you please explain why you need them on .NETCoreApp?
Hi Viktor, thank you very much! In our case, we just need the System.Reflection.Emit.PEFileKinds because we are relying upon an old third-party NET Framework DLL that is using this particular type. I felt it was worth mentioning all the other types, because some other old NET Framework DLLs that are now being used in NET Core with the NET Framework compatibility shim might still require them.
Reacted by Viktor Hofer
ghost locked as resolved and limited conversation to collaborators on Sep 16, 2023
Activity
jkotas commentedon Aug 15, 2023
cc @ViktorHofer
Add missing type forwards
Add missing type forwards
ViktorHofer commentedon Aug 16, 2023
Thanks for letting us know @jimm98y. I just submitted #90669 to fix this and also triggered a backport into .NET 8.
ViktorHofer commentedon Aug 16, 2023
@jimm98y actually here's a follow-up question. As some/all of these type are just stubs on .NETCoreApp and don't do anything, can you please explain why you need them on .NETCoreApp?
[release/8.0-rc1] Add missing type forwards (#90673)
Add missing type forwards (#90669)
jimm98y commentedon Aug 17, 2023
Hi Viktor, thank you very much! In our case, we just need the System.Reflection.Emit.PEFileKinds because we are relying upon an old third-party NET Framework DLL that is using this particular type. I felt it was worth mentioning all the other types, because some other old NET Framework DLLs that are now being used in NET Core with the NET Framework compatibility shim might still require them.