I want to create a resource file programmatically. I managed to do so following this link: https://msdn.microsoft.com/en-us/library/gg418542(v=vs.110).aspx
And I got this code:
ResXResourceWriter resx = new ResXResourceWriter(@".\Resources\resources.en.resx");
resx.Close();
It's working but it wants to create the file in the "Resources" folder in "C:\Program Files (x86)\IIS Express". But I want it to create the file in the dedicated "Resources" folder in my asp.net project, how to I point to that map relatively?
If you want it to write to a specific location I would suggest something like this
string resFilePath = ConfigurationManager.AppSettings["ResourceFilePath"];
ResXResourceWriter resx = new ResXResourceWriter(Path.Combine(resFilePath, "\Resources\resources.en.resx"));
resx.Close();
Putting the base path in the config allows you to change it when you deploy your application.
Remember that the code runs under the context of the running application though, so whatever account it runs as will require write access to your resource directory.