Getting xunit to supply app.config in .NET Core 2.0

I am trying to run SpecFlow under the .NET kernel using xunit as a test runner. As part of the test, SpecFlow loads its configuration with a call ConfigurationManager.GetSection("specFlow").

The project refers to the package System.Configuration.ConfigurationManagerto include this call in .NET Core, however it seems to want to load the configuration from my NuGet cache.

.nuget \ packages \ microsoft.testplatform.testhost \ 15.3.0 \ Lib \ netstandard1.5 \ testhost.dll.config

As a result, the SpecFlow configuration section was not found, and it returns to trying to load the NUnit component (which, of course, does not work).

Is there any way to get ConfigurationManagerto get the configuration from another place, so the calls GetSectionwill return the expected configuration values?

+4
source share

Source: https://habr.com/ru/post/1687565/


All Articles