ARs
ARs

Reputation: 486

What does XmlSerializer use to compile assemblies?

What utility, I assume command line, does XmlSerializer use to generate the temporary assembly when constructing an instance of the XmlSerializer class?

XmlSerializer serializer = new XmlSerializer(type);

In this constructor XmlSerializer uses something to compile a temporary assembly in this constructor, what?

Upvotes: 1

Views: 287

Answers (3)

Patrick Hofman
Patrick Hofman

Reputation: 157118

They use the built-in C# code compiler using the CSharpCodeProvider (which eventually calls csc).

The existence of System.CodeDom.Compiler in the reference source does indicate that.

Some digging revealed this line that shows the compiler.

Upvotes: 1

abhi
abhi

Reputation: 3136

There are two serialization tools that the generator uses. Here is a reference to it in MSDN.

https://msdn.microsoft.com/en-us/library/bb924517%28v=vs.110%29.aspx I believe you're looking for the

XML Serializer Generator Tool (Sgen.exe)

Upvotes: 0

Dead.Rabit
Dead.Rabit

Reputation: 1975

none, it used reflection exclusively in the last implementation I checked out.

FYI - implementation was changed in .Net 4.5.1 which broke lot's of my web services :(

what version of .Net are you running your app on?

Upvotes: 0

Related Questions