I have been facing an unusual problem, in my unit test project I am getting this error, also the strange thing is some tests which normally pass, fail in next run. With this error I am also getting AutoMapperMappingExceptions, although I am trying to load all the profiles from the assembly. I have checked my app.config too for potential errors. I am running xunit2, automapper 3.2.1. I am attaching part of the stack trace
System.Configuration.ConfigurationErrorsException
Configuration system failed to initialize
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Web.Configuration.ClientRuntimeConfig.GetSectionObject(String sectionName)
at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
at System.Web.Configuration.RuntimeConfig.get_HttpRuntime()
at System.Web.Util.HttpEncoder.GetCustomEncoderFromConfig()
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at System.Web.Util.HttpEncoder.get_Current()
at System.Web.HttpUtility.HtmlDecode(String s)