Note that there are some explanatory texts on larger screens.

plurals
  1. POHow should I organize project-specific read-only files in c#
    primarykey
    data
    text
    <p>My standalone smallish C# project requires a moderate number (ca 100) of (XML) files which are required to provide domain-specific values at runtime. They are not required to be visible to the users. However I shall need to add to them or update them occasionally which I am prepared to do manually (i.e. I don't envisage a specific tool, especially as they may be created outside the system).</p> <p>I would wish them to be relocatable (i.e. to use relative filenames). What options should I consider for organizing them and what would be the calls required to open and read them?</p> <p>The project is essentially standalone (not related to web services, databases, or other third-party applications). It is organised into a small number of namespaces and all the logic for the files can be confined to a single namespace.</p> <p>========= I am sorry for being unclear. I will try again. In a Java application it is possible to include resource files which are read relative to the classpath, not to the final *.exe. I believe there is a way of doing a similar thing in C#. </p> <p>========= I believe I should be using somthing related to RESX. See (RESX files and xml data <a href="https://stackoverflow.com/posts/1205872/edit">https://stackoverflow.com/posts/1205872/edit</a>). I can put strings in a resx files, but this is tedious and error-prone and I would prefer to copy them into the appropriate location.</p> <p>I am sorry to be unclear, but I am not quite sure how to ask the question.</p> <p>========= The question appears to be very close to (<a href="https://stackoverflow.com/questions/474055/c-equivalent-of-getclassloader-getresourceasstream">C# equivalent of getClassLoader().getResourceAsStream(...)</a>). I would like to be able to add the files in VisualStudio - my question is where do I put them and how do I indicate they are resources?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload