【发布时间】:2016-07-21 14:03:10
【问题描述】:
我正在构建一个引用类库项目的 ASP.NET Core 应用程序。此类库尝试设置端点。由于我已包含 Microsoft.AspNetCore.Identity.EntityFrameworkCore 我得到以下异常:
{System.IO.FileLoadException: Die Datei oder Assembly "System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: "System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
bei System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
bei System.Reflection.RuntimePropertyInfo.get_Signature()
bei System.Reflection.RuntimePropertyInfo.get_PropertyType()
bei NServiceBus.Conventions.<>c.<.ctor>b__21_2(PropertyInfo p)
bei NServiceBus.Conventions.IsEncryptedProperty(PropertyInfo property)
=== Zustandsinformationen vor Bindung ===
LOG: DisplayName = System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///D:/enio_tfs/enio.InvoiceR/Main/enio.InvoiceR.WebApp/bin/Debug/net461/win7-x64/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : EntityFramework.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Die Anwendungskonfigurationsdatei wird verwendet: D:\enio_tfs\enio.InvoiceR\Main\enio.InvoiceR.WebApp\bin\Debug\net461\win7-x64\enio.InvoiceR.WebApp.exe.Config
LOG: Die Hostkonfigurationsdatei wird verwendet:
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config wird verwendet.
LOG: Verweis nach der Richtlinie: System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Download von neuem URL file:///D:/enio_tfs/enio.InvoiceR/Main/enio.InvoiceR.WebApp/bin/Debug/net461/win7-x64/System.Interactive.Async.DLL.
WRN: Der Vergleich des Assemblynamens führte zum Konflikt: Hauptversion.
ERR: Das Setup der Assembly konnte nicht abgeschlossen werden (hr = 0x80131040). Die Suche wurde beendet.
}
当我尝试启动端点 (Endpoint.Start...) 时发生此异常
当我从扫描中排除程序集 System.Interactive.Async.dll 时,我认为异常可能会消失,因此我更改了端点配置代码:
endpointConfiguration.ExcludeAssemblies("System.Interactive.Async.dll", "System.Interactive.Async");
但不幸的是,这没有效果。例外保持不变。
顺便问一下,现在有人可以排除所有 Microsoft.* 和 System.* DLL 吗? ASP.NET Core 将所有这些 DLL 放入 bin 目录中。因此,我有超过 100 个这样的 DLL,并且初始扫描需要很长时间。
【问题讨论】:
标签: c# asp.net nservicebus