需要任何帮助,想法来解决这个问题。
我们正在开发一个应用程序,该应用程序使用ERPConnect调用SAP发布一些数据。我们在WCF服务中的一个实体框架调用中遇到以下问题。我们使用的是.NET4.0,Win 2008服务器。
以下信息包含在活动中:
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发布于 2010-09-15 19:49:53
还有一些需要注意的东西:
发布于 2010-11-09 04:31:15
这个问题得到解决了吗?我也遇到了类似的问题
InvalidProgramException: Common Language Runtime detected an invalid program。
当动态代理尝试为类型为decimal的主键设置属性时,会发生异常。这和我遇到的错误情况是一样的。我可以用一个简单的Gridview和一个由一个表组成的数据库来重现这个问题。
我使用标准的POCO模板来生成上下文和代理。
一种解决方法是将主键更改为int,如果在您的环境中这是可能的话。它看起来像是框架中的一个bug。
https://stackoverflow.com/questions/3717091
复制相似问题