我使用Windows Azure sdk发布了我的解决方案,现在我收到此错误:
' /'中的服务器错误应用。
无法加载文件或程序集System.Runtime.Serialization,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e'或其中一个依赖项。系统找不到指定的文件 描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。异常详细信息:System.IO.FileNotFoundException:无法加载文件或程序集System.Runtime.Serialization,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e&#39 ;或其中一个依赖项。系统找不到指定的文件。
源错误:在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。
程序集加载跟踪:以下信息有助于确定程序集“System.Runtime.Serialization”,“Version = 2.0.5.0”,“Culture = neutral”,“PublicKeyToken = 7cec85d7bea7798e&#39”的原因;无法加载。
WRN :程序集绑定日志记录已关闭。 要启用程序集绑定失败日志记录,请将注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)设置为1。 注意:程序集绑定失败日志记录会导致一些性能损失。 要关闭此功能,请删除注册表值[HKLM \ Software \ Microsoft \ Fusion!EnableLog]。
堆栈跟踪:[FileNotFoundException:无法加载文件或程序集' System.Runtime.Serialization,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e'或其中一个依赖项。系统找不到指定的文件。]
System.ModuleHandle.ResolveType(RuntimeModule模块,Int32 typeToken,IntPtr * typeInstArgs,Int32 typeInstCount,IntPtr * methodInstArgs,Int32 methodInstCount,ObjectHandleOnStack类型)+0
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module,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 [] genericMethodArguments)+319
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,布尔& isVarArg)+203
System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule,Int32 decoratedMetadataToken,RuntimeType attributeFilterType,Int32 attributeCtorToken,Boolean mustBeInheritable)+745
System.Reflection.CustomAttribute.IsDefined(RuntimeType类型,RuntimeType caType,布尔继承)+300
System.ServiceModel.Description.TypeLoader.CreateMessageDescription(MethodInfo methodInfo,Boolean isAsync,Boolean isTask,Type taskTResult,XmlName returnValueName,String defaultNS,String action,XmlName wrapperName,String wrapperNamespace,MessageDirection direction)+415
System.ServiceModel.Description.TypeLoader.CreateOperationDescription(ContractDescription contractDescription,MethodInfo methodInfo,MessageDirection direction,ContractReflectionInfo reflectionInfo,ContractDescription declaringContract)+1895
System.ServiceModel.Description.TypeLoader.CreateOperationDescriptions(ContractDescription contractDescription,ContractReflectionInfo reflectionInfo,Type contractToGetMethodsFrom,ContractDescription declaringContract,MessageDirection direction)+276
System.ServiceModel.Description.TypeLoader.CreateContractDescription(ServiceContractAttribute contractAttr,Type contractType,Type serviceType,ContractReflectionInfo& reflectionInfo,Object serviceImplementation)+1307
System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(类型contractType,类型serviceType,对象serviceImplementation)+289
System.ServiceModel.Description.ContractDescription.GetContract(类型contractType,类型serviceType)+192
System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts)+591
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)+166
System.ServiceModel.ServiceHost..ctor(类型serviceType,Uri [] baseAddresses)+474
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(类型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:服务' /CarManagerApi.svc'由于编译期间的异常,无法激活。异常消息是:无法加载文件或程序集System.Runtime.Serialization,Version = 2.0.5.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e'或其中一个依赖项。该系统找不到指定的文件..] System.Runtime.AsyncResult.End(IAsyncResult result)+622882
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)+196075
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)+282
我无法在代码中找到错误。 有什么问题?
答案 0 :(得分:2)
我的问题在同一解决方案的项目中是不同的.Net框架
答案 1 :(得分:0)
听起来框架2.0没有安装在远程机器上。
答案 2 :(得分:0)
我在库中使用Newtonsoft.Json遇到了这个问题。该库在Windows上运行良好,但在OS X上与Mono一起使用时会因此错误而死亡。
为了让它运行,我不得不将实际的System.Runtime.Serialization.dll复制到应用程序目录中。
显然,这不是一个很好的解决方案,但它确实有效。