2015-12-23 87 views
0

我一直试图将我的应用程序的服务器端从Azure移动服务切换到Azure应用服务,以获得更好的薪酬灵活性。我终于得到它在本地调试器上运行,但是当我部署到服务器时,我得到一个错误页面。我进入门户网站的诊断,我得到这个错误。任何想法都表示赞赏。Azure应用服务:无法加载文件或程序集Microsoft.Azure.Mobile.Server

Exception information: 
    Exception type: FileLoadException 
    Exception message: Could not load file or assembly 'Microsoft.Azure.Mobile.Server, 
    Version=0.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
    or one of its dependencies. The located assembly's manifest definition does not match 
    the assembly reference. (Exception from HRESULT: 0x80131040) 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 
    (Boolean inherit) at Owin.Loader.DefaultLoader.SearchForStartupAttribute 
    (String friendlyName, IList`1 errors, Boolean& conflict) at 
    Owin.Loader.DefaultLoader.GetDefaultConfiguration(String friendlyName, IList`1 errors) 
    at Owin.Loader.DefaultLoader.LoadImplementation(String startupName, IList`1 errorDetails) 
    at Owin.Loader.DefaultLoader.Load(String startupName, IList`1 errorDetails) 
    at Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() at 
    Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() 
    at System.Threading.LazyInitializer.EnsureInitializedCore[T] 
    (T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) at 
    Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) at 
    System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS 
    (IntPtr appContext, HttpContext context, MethodInfo[] handlers) at 
    System.Web.HttpApplication.InitSpecial(HttpApplicationState state, 
    MethodInfo[] handlers, IntPtr appContext, HttpContext context) at 
    System.Web.HttpApplicationFactory.GetSpecialApplicationInstance 
    (IntPtr appContext, HttpContext context) at 
    System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) 

回答

1

请检查您通过NuGet引用的软件包版本,如果可能,请更新到最新版本。上一次发布的Microsoft.Azure.Mobile.Service版本是1.0.0.0。

我认为你的一个依赖正试图加载0.1.0.0 dll版本。

如果更新NuGet包不会改变任何内容,您可以添加一个绑定重定向,将所有调用重定向到项目中引用的0.1.0.0版本(请参阅:https://msdn.microsoft.com/fr-fr/library/eftw1fys(v=vs.110).aspx)。

希望这有助于

朱利安

相关问题