LinqToSql项目已添加。键入字典

时间:2013-02-05 09:30:22

标签: c# linq-to-sql

很随机我们收到错误,说已经添加了Item。当我们查询LinqToSql数据上下文时键入字典,唯一的方法是重启IIS。

错误讯息:

  
    

错误消息:项目已添加。键入字典:'Int32 Single1 [System.Int32]“> Int32'     正在添加的密钥:'Int32     单[的Int32](System.Collections.Generic.IEnumerable1 [System.Int32])'

  
     

堆栈追踪:

     
    

Stack Trace:at System.Reflection.CerHashtable 2.Insert(K[] keys, V[] values, Int32& count, K key, V value) at System.Reflection.CerHashtable 2.Preallocate(Int32 count)at at     System.RuntimeType.RuntimeTypeCache.GetGenericMethodInfo(RuntimeMethodHandleInternal     genericMethod)在System.RuntimeType.GetMethodBase(RuntimeType     reflectType,RuntimeMethodHandleInternal methodHandle)at     System.Reflection.RuntimeMethodInfo.MakeGenericMethod(类型[]     methodInstantiation)at     System.Linq.Queryable.Count [TSource](IQueryable 1 source) at Triton.CRM.OrganisationType.LoadOrganisationTypeInformation() in c:\Users\timg\Documents\Visual Studio 2012\Projects\Triton V2\TritonDataSets\Organisation\OrganisationType.cs:line 82 at Triton.CRM.OrganisationType.get_OrganisationTypeName() in c:\Users\timg\Documents\Visual Studio 2012\Projects\Triton V2\TritonDataSets\Organisation\OrganisationType.cs:line 31 at Triton.CRM.OrganisationType.GetAllData(Int32 PageSize, Int32 Currentpage, String sortField, String sortOrder, String query, Int32 personId, Int64 organisationId, String groupIdListCtv, String select, String searchValue, Boolean useFullTextSearch, List 1 groupIdList)in     c:\ Users \ timg \ Documents \ Visual Studio 2012 \ Projects \ Triton     V2 \ TritonDataSets \ Organization \ OrganisationType.cs:第255行     CustomPages_GetFranchiseeSummary.Page_Load(Object sender,EventArgs e)     在System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,     Object o,Object t,EventArgs e)at     System.Web.UI.Control.LoadRecursive()at     System.Web.UI.Page.ProcessRequestMain(布尔     includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)

  

我发现很多帖子都提到它与System.Reflection.RuntimeMethodInfo.MakeGenericMethod中的错误有关但没有解决方案。

我也在Microsoft Connect上发现了这一点,但是他们说它已在.net 4中修复并且正在运行.net 4.5

https://connect.microsoft.com/VisualStudio/feedback/details/738253

0 个答案:

没有答案