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
Serialization of an internal implementation of a public interface to XML doesn't work.
Reproduction Steps
Write a public interface, implement it with an internal class, then try to serialize an instance of the class with System.Text.Json.JsonSerializer and with System.Xml.Serialization.XmlSerializer.
Expected behavior
Both should work.
Actual behavior
XML serialization fails with:
An error occurred while trying to create an XmlSerializer for the type 'InfoferScraper.Models.Train.TrainScrapeResult'.
System.InvalidOperationException: InfoferScraper.Models.Train.TrainScrapeResult is inaccessible due to its protection level. Only public types can be proce
ssed.
Regression?
No response
Known Workarounds
No response
Configuration
.NET 5
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
Serialization of an internal implementation of a public interface to XML doesn't work.
Reproduction Steps
Write a public interface, implement it with an internal class, then try to serialize an instance of the class with
System.Text.Json.JsonSerializer
and withSystem.Xml.Serialization.XmlSerializer
.Expected behavior
Both should work.
Actual behavior
XML serialization fails with:
Regression?
No response
Known Workarounds
No response
Configuration
.NET 5
Other information
No response
The text was updated successfully, but these errors were encountered: