Having a bit of an issue here. I’m creating an application in Visual Studio 2010 in C# (Windows Forms).
The UI is going to be done in a WebBrowser (so I can use jQuery goodness and for ease of development).
For this I want to create a folder called HTML which will store all my HTML files and my javascript files.
My colleague tells me to create the folder separately and copy and paste into the compiled application directory referencing the files using: System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "HTML\\FirstPage.htm" etc…
This seems strange to me. His argument is sound – if you need to edit/change anything then you don’t need to open your VM (we’re on Macs) open Visual Studio, edit, recompile, redistribute etc you just open the HTML files in the application directory. (my argument to this was that its just not that much extra work!)
I can see problems coming when different versions of the HTML files start getting mixed up and such, and to me it feels more “right” to compile the files directly as resources – OR… at least have them as files within the project explorer in Visual Studio.
So my question is: What would be the best way to do this? Would it be best to compile the HTML files as resources (and how would I do that? I’m very new to all this)? Or would it be better to do it the way my colleague said? If so is there a way to get Visual Studio to automatically copy the latest version of the files into the application directory at build time?
Thanks a lot.
No need for resources, they are far less manageable.
Easiest solution will be to add the folder with all the files to the project, and then, in their properties set:
That’s it!
Now whenever you compile your project, all these files would be updated with the latest version.