1

Working in C# under .NET 4.5. I have looked through questions here and also performed many Google and MSDN searches, and cannot find any explanation or definition for the "location" parameter of this overload of the XMLSerializer constructor. I don't know if it is a namespace, URI, path, etc. Can anyone tell me what this parameter indicates?

Thanks.

Peter Howe
  • 429
  • 6
  • 19

2 Answers2

3

If all else fails, use the source. location is ultimately passed to the constructor of TempFileCollection by XmlSerializerCompilerParameters. If no value is supplied, one is taken from the configuration file (specifically the tempFilesLocation key from the system.xml.serialization section), with which we can confirm its true purpose: it's the location for temporary files generated (and read back) by the XML serializer. It's true that the documentation is particularly obtuse on this point.

Jeroen Mostert
  • 27,176
  • 2
  • 52
  • 85
  • Thanks, that explains it. I have been doing Microsoft development for a lot of years, and I'm still not used to being able to see the source for anything Microsoft! I'll do my best to remember that avenue next time before posting questions... – Peter Howe Oct 03 '16 at 12:37
2

If you follow through the reference source you end up here.

It would seem it's the directory that XmlSerializer will put the serializer assembly it generates.

If not specified (which is the case with all other overloads), it uses the TempFilesLocation which can be configured per this related question.

Community
  • 1
  • 1
Charles Mager
  • 25,735
  • 2
  • 35
  • 45