2015-12-23 136 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)。

希望這有助於

朱利安

相關問題