开发者

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 se开发者_StackOverflow社区rvice. 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜