-3

I have an xml named Mapping.xml stored in my local system. i am accessing in code ,in my local system like XDocument xd = new XDocument(@"D:\MVCPopup\Mapping.xml"); .But i don't think this will work if i deploy it in iis server due to the folder structure change.Do we have a generic mechanism which will find the file Mapping.xml. Will Server.Mappath will work here?

peter
  • 8,158
  • 21
  • 66
  • 119

1 Answers1

1

Server.MapPath returns the phisical address from a virtual one. So if you configure a virtual folder on the iis that maps to the folder you save your XML in, then yes, Server.MapPath will help.

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121