I\'ve created a simple unit test project to read an app.config file. Target framework is Core 2.0. I also created a Core 2.0 console app, to sanity-check myself to make sure
If you check the result of the call to ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
It should tell you where the required configuration file should be while running unit tests for that assembly.
I found that instead of having an app.config
file, ConfigurationManager was looking for a testhost.dll.config
file.
This was for a project targeting netcoreapp2.1
, with a reference to Microsoft.NET.Test.Sdk
,NUnit 3.11
and Nunit3TestAdapter 3.12.0