通过Windows Azure发布后无法加载文件或程序集System.Runtime.Serialization.<



我使用Windows Azure sdk发布了我的解决方案,现在我得到了这个错误:

'/'应用程序中的服务器错误。
无法加载文件或程序集"System.Runtime"。序列化,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e'或其依赖项之一。系统找不到指定的文件
描述当前web请求执行过程中出现未处理的异常。请查看堆栈跟踪以获得有关错误及其在代码中的起源位置的更多信息。

<异常细节/strong>System.IO.FileNotFoundException:无法加载文件或程序集。序列化,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e'或其依赖项之一。系统找不到指定的文件

源误差:当前web请求执行过程中产生了一个未处理的异常。有关异常的来源和位置的信息可以使用下面的异常堆栈跟踪来识别。

程序加载跟踪:以下信息有助于确定程序集"System.Runtime. runtime"的原因。序列化,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e'无法加载。

WRN:程序集绑定日志被关闭。要启用程序集绑定失败日志记录,请设置注册表值[HKLMSoftwareMicrosoftFusion!]EnableLog] (DWORD)到1。注意:程序集绑定失败日志记录会带来一些性能损失。要关闭此功能,请删除注册表值[HKLMSoftwareMicrosoftFusion!EnableLog]。

堆栈跟踪[FileNotFoundException:无法加载文件或程序集]序列化,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e'或其依赖项之一。
system . modulehandle。ResolveType(RuntimeModule模块,Int32 typeToken, IntPtr* typeinststargs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack类型)+0
System.ModuleHandle。ResolveTypeHandleInternal(RuntimeModule模块,Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +371
System.ModuleHandle。ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +19
System.Reflection.RuntimeModule。ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericmethodararguments) +319
System.Reflection.CustomAttribute。FilterCustomAttributeRecord(CustomAttributeRecord);lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedatattributes, RuntimeType&attributeType IRuntimeMethodInfo&男星,Boolean&ctorHasParameters Boolean&isVarArg) +203
System.Reflection.CustomAttribute。IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable) +745
system . reflection.com customattribute。IsDefined(RuntimeType type, RuntimeType cattype, Boolean inherit) +300
system . servicemodel . description . typeeloader。CreateMessageDescription(MethodInfo MethodInfo, Boolean isAsync, Boolean isTask, Type taskTResult, XmlName returnValueName, String defaultNS, String action, XmlName wrapperName, String wrapperNamespace, MessageDirection方向)+415
system . servicemodel . description . typeeloader。CreateOperationDescription(ContractDescription ContractDescription, MethodInfo MethodInfo, MessageDirection direction, ContractReflectionInfo reflectionInfo, ContractDescription declaringContract) +1895
system . servicemodel . description . typeeloader。CreateOperationDescriptions(ContractDescription ContractDescription, ContractReflectionInfo, reflectionInfo, Type contracttotmethodsfrom, ContractDescription declaringContract, MessageDirection direction) +276
system . servicemodel . description . typeeloader。CreateContractDescription(ServiceContractAttribute contractatr, contractType, serviceType, ContractReflectionInfo&
System.ServiceModel.Description.TypeLoader。LoadContractDescriptionHelper(类型为contractType,类型为serviceType,对象为serviceImplementation) +289
System.ServiceModel.Description.ContractDescription。GetContract(Type contractType, Type serviceType) +192
System.ServiceModel.ServiceHost.CreateDescription(IDictionary ' 2&
System.ServiceModel.ServiceHostBase。InitializeDescription(ur缺血ekeyedcollection baseAddresses) +166
System.ServiceModel.ServiceHost..
System.ServiceModel.Activation.ServiceHostFactory. ctor(Type serviceType, Uri[] baseAddresses) +474CreateServiceHost(Type serviceType, Uri[] baseAddresses) +42
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +569
System.ServiceModel.HostingManager。CreateService(String normalizedVirtualPath, EventTraceActivity EventTraceActivity) +1435
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo ServiceActivationInfo, EventTraceActivity EventTraceActivity) +76
System.ServiceModel.HostingManager. .EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity EventTraceActivity) +901

[ServiceActivationException: The service]/CarManagerApi。由于编译期间出现异常,无法激活Svc '。异常消息是:无法加载文件或程序集"System.Runtime"。序列化,版本=2.0.5.0,文化=中性,PublicKeyToken=7cec85d7bea7798e'或其依赖项之一。系统找不到指定的文件…]System.Runtime.AsyncResult。End(IAsyncResult result) +622882
System.ServiceModel.Activation.HostedHttpRequestAsyncResult。End(IAsyncResult result) +196075
System.Web.CallHandlerExecutionStep。OnAsyncHandlerCompletion(iasyncresultar) +282

我在代码中找不到错误。有什么问题吗?

我的问题是在同一个解决方案的项目中不同的。net框架

听起来像是远程机器上没有安装框架2.0。

我在使用Newtonsoft时遇到了这个问题。库中的Json。该库在Windows上运行良好,但在OS x上与Mono一起使用时会出现此错误。

为了让它运行,我必须将实际的System.Runtime.Serialization.dll复制到应用程序目录中。

显然这不是一个很好的解决方案,但它有效。

相关内容

最新更新