While installing this application on a client machine using ClickOnce, it never ask you for an installation path and it copies the files into two different folders with random names! Mine looked like this:
And the frustrating thing is that all dlls gets copied to the first folder and the data files to the other. So my application never found the file it needed to load and I had no idea on how to solve this as the folder names kept changing randomly with every new deployment. I think these are some caching locations and the application dlls were not available anywhere else. Do anybody know what is happening here and what is the solution?
Finally I made my Deployment work by making the data file as an embedded resource (Properties > Build Action) and reading the data as below:
Stream resourceStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(MyNamespace.MyClass.MyFile.xml");
TextReader tr = new StreamReader(resourceStream);