JD.
JD.

Reputation: 15531

Does myAssembly.xmlSerializer.dll always get generated?

I have a web service that does not use any xml attributes for serialization. I just return a string from the web service. In this case, does a serialization dll get created?

The reason I ask is I keep seeing c:\windows\temp\xxxxx.dll (where xxxxx is a random sequence of characters) every couple of weeks the web service is running. One solution is to pre-compile using sgen.exe and that might solve the problem.

Also, I saw a link that said only do this for client side libraries, but this error is on the web service side (server side), so can I still use sgen.exe?

JD

Upvotes: 1

Views: 679

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Every time you call the XmlSerializer constructor it will check the type you are trying to serialize and it will generate a temporary assembly. If the assembly already exists it will reuse it. So if your web service is a classic ASMX service it will use XmlSerializer on every request, no matter the return type. These temporary assemblies are part of the serialization process and in my opinion you shouldn't worry too much about them.

Upvotes: 2

Related Questions