Take the 2-minute tour ×

I have a winforms app which has an app.config.

If the config file is not present it is automatically generated. However it is not generated in the directory that the app is running from. I can't find it anywhere.

I know it is generated because my setting are persisted as expected.

So where has mono put it.

(running on ubuntu 10.04) mono 2.4.

It seems that on windows a deleted .config file is not regenerated (I get an error) until I do a rebuild, But on mono it quite happily continues saving my settings after I delete the config file.

share|improve this question
What code do you use to generate the config file? –  cdhowie Dec 21 '10 at 3:25
actually in winforms it generates it for you if its not pressent –  trampster Dec 21 '10 at 3:26
add comment

3 Answers

up vote 2 down vote accepted

Most times on Linux, the user does not have write access to the location of the binary.

I would look for it somewhere in your home directory, probably in ~/.config.

share|improve this answer
add comment

Check the output directory - by default the application configuration file is emitted to the same directory as the assembly.

share|improve this answer
Yes it was generated when I did the build (in visual studio) then I copied the assemblies to ubuntu and deleted the app.config, then ran the applicaiton, it generated a new config file and saved my settings, but I don't know where to. –  trampster Dec 21 '10 at 3:28
add comment

I guess you use relative path to determine the existence of the config file. Then on Linux the process executing your code is mono.exe, and it may reside in a completely different folder from your binaries, and the config file may be written to an unknown position.

Besides, your description of the problem is really ambiguous. Next time you may use step by step way and separate what happens on Windows from what happens on Linux.

share|improve this answer
add comment

Your Answer


