Определение манифеста обнаруженной сборки не соответствует ссылке на сборку: Исключение из HRESULT: 0x80131040 - PullRequest
1 голос
/ 14 мая 2019

В моем проекте microsoft.owin имеет версию 3.1.0.0, но запрашивает более старую версию 2.1.0.0.Я пытался установить microsoft.owin, но не удалось.Моя структура проекта 4.5.2.Я пытался установить пакет nuget этой сборки, но он не установлен.Может кто-нибудь сказать мне, как решить эту ошибку.Как можно установить пакет 2.1.0.0 версии.Я пытался перенаправить его, но та же ошибка.

   ERROR

   Could not load file or assembly 'Microsoft.Owin, Version=2.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)

Ошибка источника:

        Line 65:             //    ClientSecret = ""
        Line 66:             //});
        Line 67:         }
        Line 68:     }
        Line 69: }
        === Pre-bind state information ===
        LOG: DisplayName = Microsoft.Owin, Version=2.1.0.0, Culture=neutral,  PublicKeyToken=31bf3856ad364e35
        (Fully-specified)
        LOG: Appbase = file:///C:/xxxx/yyyy/uuuu/ldap/
        LOG: Initial PrivatePath = C:\xxxx\yyyy\uuuu\ldap\bin
        Calling assembly : Microsoft.AspNet.Identity.Owin, Version=2.0.0.0,      Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
        LOG: This bind starts in default load context.
        LOG: Using application configuration file: C:\xxxx\yyyy\uuuu\ldap\web.config
        LOG: Using host configuration file: \\xyz.df.xcxc.com\sdsds\yuyuy\****\My Documents\IISExpress\config\aspnet.config
        LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
        LOG: Post-policy reference: Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        LOG: Attempting download of new URL file:///C:/Users/****/AppData/Local/Temp/Temporary ASP.NET Files/root/b0f32b6a/7c9b41cc/Microsoft.Owin.DLL.
        LOG: Attempting download of new URL file:///C:/Users/****/AppData/Local/Temp/Temporary ASP.NET Files/root/b0f32b6a/7c9b41cc/Microsoft.Owin/Microsoft.Owin.DLL.
        LOG: Attempting download of new URL file:///C:/xxxx/yyyy/uuuu/ldap/bin/Microsoft.Owin.DLL.
        WRN: Comparing the assembly name resulted in the mismatch: Major Version
        ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. 

Трассировка стека:

          [FileLoadException: Could not load file or assembly 'Microsoft.Owin, Version=2.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)]
   ldap.Startup.ConfigureAuth(IAppBuilder app) in C:\xxxx\yyyy\uuuu\ldap\App_Start\Startup.Auth.cs:67
   ldap.Startup.Configuration(IAppBuilder app) in C:\xxxx\yyyy\uuuu\ldap\Startup.cs:9

         [TargetInvocationException: Exception has been thrown by the target of an invocation.]
         System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
         System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
         System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +142
   Owin.Loader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder) +93
         Owin.Loader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder) +212
         Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +873
         Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +51
         Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +101
         System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +135
         Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +160
         System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +580
         System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +165
              System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +267
          System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

          [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
          System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
          System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
          System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688

, пожалуйста, помогите решить эту проблему.как установить более старую версию microsoft.owin.

1 Ответ

1 голос
/ 14 мая 2019

Одним из решений является понижение версии Microsoft.Owin.

  1. Щелкните правой кнопкой мыши проект в Visual Studio.
  2. Выберите «Управление пакетами Nuget ...».
  3. В разделе Установлено выберите «Microsoft.Owin».
  4. В раскрывающемся списке «Версия» выберите 2.1.0
  5. Нажмите «Обновить».

enter image description here

...