Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ServiceStack:部署导致FileLoadException,can';t加载System.Runtime.Serialization_C#_<img Src="//i.stack.imgur.com/WM7S8.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">servicestack - Fatal编程技术网 servicestack,C#,servicestack" /> servicestack,C#,servicestack" />

C# ServiceStack:部署导致FileLoadException,can';t加载System.Runtime.Serialization

C# ServiceStack:部署导致FileLoadException,can';t加载System.Runtime.Serialization,c#,servicestack,C#,servicestack,我有一个非常简单的ServiceStack服务正在运行,路径是/api/Translate/。。。。这在本地非常有效。我可以查看XML、JSON等 但是,当我将项目部署到实时环境时,调用服务会导致: <TranslateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns=""> - <ResponseStatus> <ErrorCode>FileLoadException&l

我有一个非常简单的ServiceStack服务正在运行,路径是/api/Translate/。。。。这在本地非常有效。我可以查看XML、JSON等

但是,当我将项目部署到实时环境时,调用服务会导致:

<TranslateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="">
- <ResponseStatus>
  <ErrorCode>FileLoadException</ErrorCode> 
  <Message>Could not load file or assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)</Message> 
  <StackTrace>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(RuntimeType type, RuntimeType caType, Boolean inherit) at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) at ServiceStack.WebHost.EndPoints.Utils.FilterAttributeCache.GetResponseFilterAttributes(Type responseDtoType) in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\Utils\FilterAttributeCache.cs:line 51 at ServiceStack.WebHost.Endpoints.EndpointHost.ApplyResponseFilters(IHttpRequest httpReq, IHttpResponse httpRes, Object responseDto) in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\EndpointHost.cs:line 205 at ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\RestHandler.cs:line 64</StackTrace> 
  </ResponseStatus>
  </TranslateResponse>

- 
FileLoadException
无法加载文件或程序集“System.Runtime.Serialization,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e,Retargetable=Yes”或其依赖项之一。给定的程序集名称或代码基无效。(来自HRESULT的异常:0x80131047)
在System.ModuleHandle.ResolveType(RuntimeModule模块、Int32 typeToken、IntPtr*typeInstArgs、Int32 typeInstCount、IntPtr*methodInstArgs、Int32 methodInstCount、ObjectHandleOnStack类型)在System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule模块、Int32 typeToken、RuntimeTypeHandle[]类型实例化上下文、RuntimeTypeHandle[]System.Reflection.CustomAttribute.FilterCustomAttribute.ResolveType(Int32 metadataToken,类型[]genericTypeArguments,类型[]genericMethodArguments)的System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,类型[]genericTypeArguments,类型[]genericMethodArguments)上的MethodInstanceContext)(CustomAttributeRecord CareCold,MetadataImport作用域,Assembly&LastAptCookAssembly,RuntimeModule decoratedModule,MetadataToken decoratedToken,RuntimeType attributeFilterType,Boolean必须不可编辑,Object[]属性、IList derivedAttributes、RuntimeType和attributeType、IRontimeMethodInfo和ctor、Boolean和ctorHasParameters、Boolean和isVarArg)位于System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule、Int32 decoratedMetadataToken、Int32 pcaCount、RuntimeType attributeFilterType、Boolean mustBeInheritable、IList derivedAttributes、Boolean isDecoratedTargetSecurityTransparent)位于System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType、RuntimeType CatType、Boolean inherit)ServiceStack.WebHost.EndPoints.Utils.FilterAttributeCache.GetResponseFilterAttributes(类型responseDtoType)中的System.RuntimeType.GetCustomAttributes(类型attributeType,布尔继承)在C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\Utils\FilterAttributeCache.cs中:ServiceStack.WebHost.EndPoints.EndPoints.EndpointHost.ApplyResponseFilters的第51行(IHttpRequest httpReq、IHttpResponse HttpResponse、Object responseDto)在C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\EndpointHost.cs中:在C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints.RestHandler.ProcessRequest中的第205行(IHttpRequest httpReq、IHTTPreponse httpRes、String operationName),在C:\src\ServiceStack\WebHost.EndPoints\RestHandler.cs中:第64行
TranslaterResponse是我的健康数据。ResponseStatus不是我的。我已检查.NET版本目标,并已将System.Runtime.Serialization设置为“Copy Local”,并手动将DLL包含在/bin文件夹中

但它仍然不起作用。我哪里出了问题?

解决了它

它包含了一个使用可移植类库项目构建的项目。这似乎太好了,不可能是真的。已经删除了(它解决了其他问题,主要是MVVM实现)和所有工作。

解决了它


它包含了一个使用可移植类库项目构建的项目。这似乎太好了,不可能是真的。已经删除了(它解决了其他问题,主要是MVVM实现)和所有工作。

您的live环境运行在中等信任度下吗?根据IIS7,完整(内部).您的实时环境是否在中等信任度下运行?根据IIS7,完整(内部)。