我们的在线产品之一间歇性地返回空引用时遇到了一些问题,返回的堆栈跟踪如下:
System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllKeys()
at System.Collections.Specialized.NameValueCollection.get_AllKeys()
at System.Data.Entity.Internal.AppConfig.Convert(NameValueCollection collection)
at System.Data.Entity.Internal.AppConfig..ctor()
at System.Data.Entity.Internal.AppConfig..cctor()
--- End of inner exception stack trace ---
at System.Data.Entity.DbContext..ctor(String nameOrConnectionString)该产品正在使用EF4.3 (我知道我们可以升级,尽管我想先找出原因),而且似乎大部分时间都在工作,所以我不确定这是否是我们的代码。
有没有人见过这样的问题,或者知道它是否在EF的后续版本中被解决了?
发布于 2016-01-27 08:09:12
这看起来像一个EF错误,升级到新版本消除了问题。
https://stackoverflow.com/questions/20844561
复制相似问题