Last post Jun 08, 2018 02:54 PM by PatriceSc
Jun 08, 2018 02:02 PM|cfcorp|LINK
I have a console app running is windows server 2016. I am creating an XML file which I want to be able to access in an ASP app pointed at my web pages directory.
The application when run on my localhost saves the XML file to the local directory the console app is in. I am running the debug .exe.
I have moved the app to the Server but it saves the XML files in SYSWOW.
I have tried the following but it makes no difference when saving the XML file.
I usually would in a .net use Server.Mappath to save files.
Jun 08, 2018 02:21 PM|mgebhard|LINK
Frankly, there's not enough code to make guess. Let's start with something simple. What is the value of "save"? What is doc an XML doc? How is the console app invoked? Do you have an empty catch blocks hiding errors?
Usually before saving a file you check if the directory exists etc. Please see the reference docs.
Jun 08, 2018 02:54 PM|PatriceSc|LINK
Could it be that you saved the file to "c:\inetpub\wwwroot\FilesABC.xml" rather than to "c:\ìnetpub\wwwroot\Files\ABC.xml" ? https://msdn.microsoft.com/en-us/library/fyy7a5kt(v=vs.110).aspx can
help to avoid this kind of bug.
If you are unsure about the location for your folder, use Server.MapPath in your web app to show which location should be used in the console app.