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
As @MichalPetryka pointed out to me, .NET [Core] doesn't support Assembly.ReflectionOnlyLoad[From] which makes this significantly more complicated to fix. Ideally I would like the code to use MetadataLoadContext but the XmlReflectionImporter class used under the covers heavily depends on the types existing in the same context which makes such fix non-trivial.
The XML serializer generator uses
Assembly.LoadFile
to examine the original assembly for serializable types:https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs#L480C24-L480C41
Can it result in unintended code execution (eg. module initilizers)? Wouldn't it be more appropriate to use
Assembly.ReflectionOnlyLoad
?The text was updated successfully, but these errors were encountered: