XmlSerializer treated as private, although is public

72 views Asked by At
internal XmlSerializer wut = new XmlSerializer();

gives me compiler error cs0122. When mousing over XmlSerialzier it is listed as a public class. Any guesses?

I would provide relevant content, but I have no clue where the issue might be.

1

There are 1 answers

5
Dirk On BEST ANSWER

You are trying to instantiate a XmlSerializer object using the parameterless constructor.

But when you look at the class you'll see that this particular constructor is protected which means you can't use it directly.

You have to use one of the other public constructors to create on object of the XmlSerializer class.