System.Configuration.ConfigurationErrorsException using xuni



我一直面临一个不寻常的问题,在我的单元测试项目中,我遇到了这个错误,奇怪的是一些测试通常会通过,在下次运行时失败。有了这个错误,我也得到了自动映射器映射异常,尽管我正在尝试从程序集加载所有配置文件。我也检查了我的app.config是否存在潜在错误。我正在运行 xunit2,自动映射器 3.2.1。我正在附加部分堆栈跟踪

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)

这是一个框架错误,与AM无关。例如,格式错误的配置文件会导致这种情况。应该有一个包含更多详细信息的内部例外。

最新更新