8

I kept getting errors in my log file that messageconfig file not found. It turned out that my application was expecting it in the bin\debug folder. What causes the application to expect so? It seems that when project is built it should copy the config file in bin\debug folder. Am i missing a certain project setting?

dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200
  • 1
    What is the extension of `messageconfig`? `.config`? If so, it *should* copy it to the bin\debug folder and it is expected there because it is expected to live alongside the assembly/app it is configuring. When you select that file in Solution Explorer, what does it say for "Copy to Output Directory" in the Properties window? – Kirk Woll Oct 05 '10 at 18:33

4 Answers4

18

App/web.Config files are expected to be in the same directory as the application/web root.

Other, referenced config files may be in other directories, as specified in the main configuration file.

If you right click on the .config file, then on properties there is a Copy to Ouput Directory entry.

This should be set to either Copy if Newer or Copy always, if this is set to Do not copy, the .config will not by copied to the debug/release folder where it is expected.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
1

Config files are expected to be in the same location as the executing assembly.

Check out this SO question: .NET 2.0 Application Settings (user.config) file location

Community
  • 1
  • 1
Sam Trost
  • 2,173
  • 20
  • 26
0

You could set the files build action to "Copy always"..

Matt
  • 2,730
  • 4
  • 28
  • 35
0

usually you only need the .exe. Try to clean and rebuild your project..

Hope it helps

Gerben Limburg
  • 581
  • 5
  • 16