CLR检测到无效程序

Eve*_*ers 2 .net c# clr sap entity-framework

需要任何帮助,想法来找出这个问题.

我们正在开发一个应用程序,该应用程序调用SAP以使用ERPConnect发布一些数据.我们在WCF服务中的一个Entity Framework调用中遇到以下问题.我们使用的是.NET4.0,Win 2008 Server.

活动中包含以下信息:

exception in getting ****getrebateproposal**-****Common Language Runtime detected an invalid program.******   at System.Data.Entity.DynamicProxies.RebateProposal_E1004D9B0153012E0A7A09FC9B574872909349EC992253740AB3C066FC63CF4D.set_Id(Decimal )
       at lambda_method(Closure , Shaper )
       at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
       at lambda_method(Closure , Shaper )
       at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
       at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at CommercialTermsRepository.GetRebateProposalsAmountToPay(String rebateAgreement) in D:\Projects\TFS\CIT V2\DataModel\BusinessObjects\CommercialTermsRepository.cs:line 794
       at SAPInterface.RebateProposalService.SetZv41Data(List`1 uploadRebates) in D:\Projects\TFS\CIT V2\Server\UserService\RebateProposalService.svc.cs:line 187
Run Code Online (Sandbox Code Playgroud)

Phi*_*eck 5

  1. 您是否尝试在exe/dll上运行PEVerify以查看是否存在任何问题?
  2. 您是否尝试在其上运行ngen以查看ngen是否失败?
  3. 您可以发布失败的代码或您的问题的小型副本吗?

还有一些要寻找的东西:

  • lambda是一种巨大的方法吗?(也就是说,它关闭了很多值吗?) - 尝试将其移出,以便不是这种情况
  • 您是否使用在params或输出中具有COM对象的委托类型?(我以前遇到过这个问题)