You can use the normal Path methods. MapPath
helps convert the virtual path to the physical path on the web server. There's no need for this conversion in winforms. You may be looking for Assembly.GetExecutingAssembly().Location which returns the location of the assembly being executed.
Edit - Your updated question should work on in a Winform.
XmlReader.Create has quite a few overloads, one of them is (string, XmlReaderSettings)
. This is the overload you're using in your question. You can use the same method, but different directory if you like.
reader = XmlReader.Create(@"C:\Data.xml", settings);
To get the directory of the executing assembly, you can use AppDomain.CurrentDomain.BaseDirectory. So it could be something like this:
reader = XmlReader.Create(AppDomain.CurrentDomain.BaseDirectory + "Data.xml", settings);