Nunit: Where does the .config file go?

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

I have created a file, called nunit_project_name.dll.config, within
the bin folder of my Nunit project, but Nunit is not able to find the
file. Is this is the right location?

I can access the proper connection string if I put in in the
machine.config file, but obviously this is not the best choice. I
must be putting the file in the wrong dir, but I have tried pretty
much every location that I can think of.

Help would be greatly appreciated.

Thanks
 
I think it should be in the same directory as the NUnit project file
nunit_project_name.nunit. I think it's also the case that by default the
..config file name should be nunit_project_name.config, not
nunit_project_name.dll.config, though you can change this default via the
GUI runner options.

If you just manually place the .config file in the output bin directory, it
may get wiped on a build. If you are using VS2005 & .NET 2.0, you can also
try the following:
1. Add the config file to the VS2005 NUnit project
2. In the properties for this file, set "Copy to output directory" to "Copy
always"
3. Check that you are reading the config settings using the .NET 2.0 API
System.Configuration.ConfigurationManager.AppSettings, rather than the .NET
1.1 API
 
For some reason the Nunit gui wasn't picking it up, but when I ran the
same tests with resharper it was able to access the .config file that
was placed in the location that you mentioned.

Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top