   Publishing an app that needs to read a file
  Basically I have made an app that reads an xml and pulls its contents. Now I publish the app, install it, and then try to run it. I get file not found. I figure it's my .xml file. What do I need to do to make sure it gets in there?*well right now, i'm gonna copy the .xml file in the Release folder, build, and publish it. hopefully that works.   
  Are you trying to read the file from a folder that no longer contains the folder after the install?   ;  what do you mean by "publish"?Ideally you've set things up so that you use relative pathing, not specific pathing.  i.e. fopen("data/config.xml") not fopen("C:/projects/data/config.xml").  The latter requires that the user have stuff installed in an exact spot. Maybe that's your problem?If your app needs an xml file to run, then you obviously have to deliver the xml file so other people can run it.  building does not magically make everything part of the exe.  Any file that your runtime uses must be available to the user.-me   ;  Sorry I didn't specify. I'm using VS 2005 EE and C#private void loadXML()   {  rssStream = new System.IO.FileStream("game.xml", System.IO.FileMode.Open);  rssDoc = new System.Xml.XmlDocument();  rssDoc.Load(rssStream);  rssStream.Close();   }];  right click on the name of your project in Solution Explorer and choose Properties then choose Publish. then go to Application Files and where it says Publish Status choose Include. then Publish as usual. that seems to work. it has so far anyway.   ;Quote:Original post by Alpha_ProgDesright click on the name of your project in Solution Explorer and choose Properties then choose Publish. then go to Application Files and where it says Publish Status choose Include. then Publish as usual. that seems to work. it has so far anyway.WTF?!?!, are you like, helping yourself?   ;Quote:Original post by DaveQuote:Original post by Alpha_ProgDesright click on the name of your project in Solution Explorer and choose Properties then choose Publish. then go to Application Files and where it says Publish Status choose Include. then Publish as usual. that seems to work. it has so far anyway.WTF?!?!, are you like, helping yourself?[lol]GameDev is funny. you ask a question. they tell you "RTFM!"You RTFM and then ask: "Why are you RTFM?!"I just figured it out and thought I share. [smile];Quote:Original post by Alpha_ProgDesQuote:Original post by DaveQuote:Original post by Alpha_ProgDesright click on the name of your project in Solution Explorer and choose Properties then choose Publish. then go to Application Files and where it says Publish Status choose Include. then Publish as usual. that seems to work. it has so far anyway.WTF?!?!, are you like, helping yourself?[lol]GameDev is funny. you ask a question. they tell you "RTFM!"You RTFM and then ask: "Why are you RTFM?!"I just figured it out and thought I share. [smile]AAAH, i was like, "Are there two Alpha_Progi?"   ;  Well, in a case like this, you can possibly add the XML file to your project, and then re-publish it.  After doing that, try again, and see if  it finds the file.  from the code you're writing, it seems that it assumes the file is there, so that may not be the best way to go about it.  You could check to see if the file is available, and then create it if you wanted.  Sort of like thisstring url = Server.MapPath("CustomSearchLog.txt");//Create Streamwriter for sending information to Log.StreamWriter Log = File.AppendText(url);//if log file does not exist, it is created here.if(!File.Exists(url))File.Create(url);//Write to logLog.WriteLine("A custom search query was performed on " + DateTime.Now + " by that one guy"); Log.Close();There may be a slight difference in obtaining the path for WinForms, but it's all mostly the same.   