- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经处理这个问题好几天了,我就是不明白为什么会出现这个错误。这是 log4net v1.2.10.0 的 FileLoadException
,但它发生在 XRM SDK linq 查询期间。我在应用程序中使用 log4net v1.2.12.0,我希望 bindingRedirect 能够解决这个问题,但事实并非如此。 (我用的一个库需要v1.2.10.0 log4net)
看起来 XRM sdk 以某种方式尝试序列化/反序列化程序集。我不确定为什么要这样做,我想 the post可能是相关的。
内部异常为空
异常信息:
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)":"log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821
服务器堆栈跟踪:
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
at Microsoft.Xrm.Sdk.KnownTypesProvider.GetProxyTypesAttribute(Assembly assembly)
at Microsoft.Xrm.Sdk.KnownTypesProvider.RegisterAssembly(Assembly assembly)
at Microsoft.Xrm.Sdk.KnownTypesProvider.get_KnownAssemblies()
at Microsoft.Xrm.Sdk.KnownTypesProvider.get_KnownOrganizationRequestResponseTypes()
at Microsoft.Xrm.Sdk.KnownTypesResolver.ResolveName(String typeName, String typeNamespace, Type declaredType, DataContractResolver knownTypeResolver)
at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromDataContractResolver(XmlQualifiedName typeName, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerContext.ResolveDataContractFromKnownTypes(String typeName, String typeNs, DataContract memberTypeContract, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerContext.IsKnownType(DataContract dataContract, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerContext.IsKnownType(DataContract dataContract, Dictionary`2 knownDataContracts, Type declaredType)
at System.Runtime.Serialization.KnownTypeDataContractResolver.TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, XmlDictionaryString& typeName, XmlDictionaryString& typeNamespace)
at Microsoft.Xrm.Sdk.KnownTypesResolver.TryResolveType(Type type, Type declaredType, DataContractResolver knownTypeResolver, XmlDictionaryString& typeName, XmlDictionaryString& typeNamespace)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.ResolveType(Type objectType, Type declaredType, XmlDictionaryString& typeName, XmlDictionaryString& typeNamespace)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteResolvedTypeInfo(XmlWriterDelegator writer, Type objectType, Type declaredType)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteTypeInfo(XmlWriterDelegator writer, DataContract contract, DataContract declaredContract)
at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiTypeAtTopLevel(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle originalDeclaredTypeHandle, Type graphType)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object graph)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameters(XmlDictionaryWriter writer, PartInfo[] parts, Object[] parameters)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter writer, MessageVersion version, Object[] parameters, Object returnValue, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Security.SecurityAppliedMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Security.SecurityAppliedMessage.OnWriteMessage(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.RetrieveEntityCollection(OrganizationRequest request, NavigationSource source)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](Expression expression)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.GetEnumerator[TElement](Expression expression)
at Microsoft.Xrm.Sdk.Linq.Query`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at ClassLibrary.Class1.Method1() in C:\Users\Greg.tarr\Documents\Visual Studio 2010\Projects\RestService\ClassLibrary\Class1.cs:line 36
最佳答案
这可能是由于项目中对 log4net 的引用不正确/过时(使用更新版本时),引用被编译到程序集中,然后尝试加载。取自here
还要确保您的 PublicKeyToken 是正确的。
如果您已通过 NuGet 更新, token 可能不正确/未更新... as per this SO post
关于c# - 使用 CRM SDK 时 log4net 的 FileLoadException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19170588/
我们使用的是在线版 CRM。我已经创建了一个自定义工作流,但我似乎无法找到任何可以告诉我如何调试它的信息。我读过的所有内容都是指将 pdb 文件复制到服务器 bin/assemblies 文件夹中。由
我正在尝试将 crm 4 插件转换为 CRM 2011。有谁知道 CRm 2011 中的相应类型是什么? Customer, CrmDateTime, CrmDecimal, CrmFloat, CB
我正在尝试将 crm 4 插件转换为 CRM 2011。有谁知道 CRm 2011 中的相应类型是什么? Customer, CrmDateTime, CrmDecimal, CrmFloat, CB
我们在 CRM 2015 中有特定要求,我们需要限制非 S/S 管理员用户在业务流程中的向后移动。 我遍历了客户端 API(包括升级 1 的脚本),但我没有找到任何 API 来使用任何公开的方法来实现
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 10年前关闭。 Improve this
必须从另一个 webresoucre 控件访问 Webresource 控件使用了以下 javascript , var webResource = $(window.parent.Xrm.Pag
在将解决方案从 CRM 2011 升级到 CRM 2015 时,我只将 crm 2011 解决方案导出 zip 中生成的 solution.xml 文件的标题更改为 然后导入crm 2015,导入成
我在 BIDS 中创建了大量报告,并将它们部署到我的 CRM 在线实例中。我遇到的问题是以下代码。 看起来很简单,但它给了我以下错误。 无效数据源:不支持报告类型。 Micro
我有一个与 this post 非常相似的问题 我已经为 Dynamics CRM 2015 安装了“Microsoft Dynamics CRM Report Authoring Extension
在我开始之前,我们的客户必须通过 AFDS 连接才能继续使用 CRM 2011。所以我们谈论的是“IFD”环境。 我在使用“CRM 2011 Outlook Client”和“Window.Open(
我注册了 Dynamic CRM 在线试用版(30 天)并创建了一个非托管自定义解决方案(新字段、一些自定义实体等)。现在,我想导出非托管解决方案并将其导入到我的服务器中的 Dynamic CRM O
我们正在 MS Dynamics CRM 2015 中对自引用实体进行建模。 一个例子是建筑物和建筑物的一部分(建筑群 ==> 独立建筑 ==> 入口 ==> 楼层 ==> 平面)。 有一些字段,如成
我们有一个系统,用户可以在其中以表格形式输入他的数据,然后我们将数据保存在 CRM 中(它在云中,因此我们无法访问它等等)。现在突然我们每次都开始出错,我们尝试发送数据。 我们得到的错误是:An un
我刚刚加载了高级查找,我无法点击一半的图标/下拉菜单,因为它们都在错误的位置。它在其他服务器和其他机器上运行良好。看起来好像是 CSS 问题。有任何想法吗 最佳答案 我在 Firefox 中遇到了同样
我正在使用带有简单 OData 的 Ms Dynamic Web Api。我需要为链接实体添加新记录。 我正在使用下面的代码片段并引用文档 https://github.com/object/Simp
我在 Dynamics CRM 中的客户和投资组合之间存在 1:N 关系即每个账户都有多个投资组合,每个投资组合都有特定的 Assets 。 我正在尝试在账户表格上创建一个字段,用于计算账户“所有相关
我在更新案例表单上 customerid 字段内的文本时遇到问题 如上图所示,我创建了一个名为“Test Contact”的联系人和一个名为“Test Account”的帐户。 我有一个在后台运行的工
爱尔兰于 3 月 27 日开始实行夏令时。从那时起,任何已添加到 Dynamics 的记录都将任何日期字段设置为比实际添加时间晚一小时。 奇怪的是,Web UI 正确返回日期,而使用 SQL Serv
我需要能够扩展在云中运行的 CRM 2011。我需要能够从一个完全独立的 Internet 网站执行 CRUD 操作。我有什么选择?我对 CRM 的经验为零。我刚刚发现 OOB Web 服务只能在 C
好吧,想象一下一家银行的调用中心充满了低信任度的员工。工作人员需要通过电话为客户提供基本服务。调用中心的工作人员接听客户的电话,询问他们某些安全问题,然后以某种方式为客户提供服务。 现在,从客户的角度
我是一名优秀的程序员,十分优秀!