TeamCity built-in NUnit runner not reading app.config entries

Exactly as the topic header says. Our test projects maintain their own app.config and user.config files (app.config appSettings refer to user.config for active database connection strings and stuff which varies based on environment). The whole setup was working fine for last few months since our first installation of teamcity. Recently we upgraded to teamcity 6.0.3 and since then one of our major project's testproject integration tests are failing continuously as they can't read app.config's appSettings keys anymore for some reason. Just to let you know, so far we have verified the following points,

1. TestProjectName.dll.config exists in TC working directory's TestProject->Bin-Debug folder.

2. I tried running the tests from the assemblies in question using NUnit GUI separately and it works fine. GUI automatically picks up the TestProjectName.dll.config file as configuration file.

Tips or hints will be greatly appreciated.

0
5 comments
Avatar
Permanently deleted user

Still looking for answer. Having hard time finding what's causing this problem

0
Avatar
Permanently deleted user

Solved. It was a totally different issue and had nothing to do with NUnit not reading app.config. Please close this thread. Thanks

0
Avatar
Permanently deleted user

Hi,
I got the same issue, may you help?
Basically, I used autofac to resolve a repository class with a connection string from app config but I always got error that the nunit test runner couldn't find the connection string then made the unit test failed.

Thanks

0
Avatar
Permanently deleted user

I found that I had to rename/copy my .dll.config to 'app.config' in order for JetBrains.BuildServer.NUnitLauncher.exe to run the tests correctly.

NUnit looks for <assembly under test>.dll.config but JetBrains.BuildServer.NUnitLauncher.exe decides to do its own thing and looks for App.config in the same directory :(

See: http://www.nunit.org/index.php?p=configFiles&r=2.6.3 for NUnit config file strategies

0

Andy, thank you for reporting the issue - https://youtrack.jetbrains.com/issue/TW-38314. Ones who is interested in it, please watch/vote for it.

0

Please sign in to leave a comment.