I\'m creating a console app in Visual Studio 2010 with c#. I want this app to be stand alone, in that all you need is the exe, and you can run it from anywhere. I also want
Best workaround looks like to create it yourself at the application startup.
Example code:
Program.cs
[STAThread]
static void Main()
{
CreateConfigIfNotExists();
}
private static void CreateConfigIfNotExists()
{
string configFile = string.Format("{0}.config", Application.ExecutablePath);
if (!File.Exists(configFile))
{
File.WriteAllText(configFile, Resources.App_Config);
}
}
Remember that it will only write your current config when building. It will not update it automatically when you deploy a new version. It will include the config as is when building. But this could be enough :)