Problem with Server.Mappath

jbogart23

New member
Joined
Sep 28, 2004
Messages
2
Programming Experience
10+
I have a aspx that passes a "full path" of an XML file to a function which then opens a stream....
All works well on the production server, but on the development server "c:\windows\system32" is appended to the path instead of what server.mappath returns.

Any Ideas?

Here are the pertinent parts of the code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XMLFilePath = Server.MapPath("includes/employees.xml").ToString
GetTreeData(XMLFilePath, viewstate("loggedInEmpID"))
End Sub

Public Function GetTreeData(ByVal XMLFilePath As String) As String
Dim xmlDoc As XmlDocument = New XmlDocument
Dim flstream As StreamReader = File.OpenText(XMLFilePath)
Dim xmlData As String = flstream.ReadToEnd
xmlDoc.LoadXml(xmlData)
flstream.Close()
 
its working

actually its not really working, it still has the same issue as before, but I found whats causing it. I rebuilt the project as a release and it works fine. Built the project once again as a debug and the issue shows back up.
 
Back
Top