为什么 System.Reactive.Windows.Threading 正在加载?
Why is System.Reactive.Windows.Threading loading?
我试图获得一个需要 System.Threading.Dll 才能与我的 .NET 3.5 Web 应用程序项目一起工作的库。由于 3.5 没有 System.Threading.Dll,我按照提示安装了 Reactive 扩展,因为它有 3.5 的反向移植版本 System.Threading。
尝试仍然失败,在受够了挫折之后,我退出了,完全放弃了这个分支。
现在在我没有任何实验性工作的原始分支中,我遇到了这个错误。
[BadImageFormatException: Could not load file or assembly 'System.Reactive.Windows.Threading' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
这个错误是有道理的。没有意义的是为什么它甚至试图首先加载 System.Reactive.Windows.Threading 程序集?解决方案中没有提及它。我什至从 OS 中完全卸载扩展。
这是绑定信息。
=== Pre-bind state information ===
LOG: User = IIS APPPOOL\.NET v2.0
LOG: DisplayName = System.Reactive.Windows.Threading
(Partial)
LOG: Appbase = file:///C:/GitHub/v44/Web/
LOG: Initial PrivatePath = C:\GitHub\v44\Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\GitHub\v44\Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/65a2449d/ebe221c1/System.Reactive.Windows.Threading.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/65a2449d/ebe221c1/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading.DLL.
LOG: Attempting download of new URL file:///C:/GitHub/v44/Web/bin/System.Reactive.Windows.Threading.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.
是什么让 .NET 认为它需要加载这个程序集?
当你说你 "installed" Rx 是什么意思?您使用了哪个 NuGet 包?你的项目有哪些 Rx 引用?确保只使用 Rx-Main
。听起来您可能使用了其中一种包含 Rx-Xaml 的风格(例如 Rx-WPF 或 Rx-Silverlight)。 Rx-Xaml 加载 System.Reactive.Windows.Threading.
http://blogs.msdn.com/b/rxteam/archive/2012/08/15/reactive-extensions-v2-0-has-arrived.aspx 描述了不同的软件包及其包含的内容。
找到了。
因此,我的解决方案中确实没有对反应式扩展的依赖。但是,需要它的旧库仍然留在我的 bin 文件夹中。卸载 nuget 包不会删除它们。
删除 nuget 包后,Clean 似乎不会删除它们。
这是我认为发生的事情。
所以它们位于我的 bin 文件夹中,该文件夹被 git 忽略,因此切换分支不会删除它们。 .NET 在 bin 文件夹中看到它们,尽管不需要它们,但仍会尝试加载它们。我还必须完全清除所有被忽略文件的工作区。
git clean -fxd
从那里开始构建,我很高兴。
我试图获得一个需要 System.Threading.Dll 才能与我的 .NET 3.5 Web 应用程序项目一起工作的库。由于 3.5 没有 System.Threading.Dll,我按照提示安装了 Reactive 扩展,因为它有 3.5 的反向移植版本 System.Threading。
尝试仍然失败,在受够了挫折之后,我退出了,完全放弃了这个分支。
现在在我没有任何实验性工作的原始分支中,我遇到了这个错误。
[BadImageFormatException: Could not load file or assembly 'System.Reactive.Windows.Threading' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
这个错误是有道理的。没有意义的是为什么它甚至试图首先加载 System.Reactive.Windows.Threading 程序集?解决方案中没有提及它。我什至从 OS 中完全卸载扩展。
这是绑定信息。
=== Pre-bind state information ===
LOG: User = IIS APPPOOL\.NET v2.0
LOG: DisplayName = System.Reactive.Windows.Threading
(Partial)
LOG: Appbase = file:///C:/GitHub/v44/Web/
LOG: Initial PrivatePath = C:\GitHub\v44\Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\GitHub\v44\Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/65a2449d/ebe221c1/System.Reactive.Windows.Threading.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/65a2449d/ebe221c1/System.Reactive.Windows.Threading/System.Reactive.Windows.Threading.DLL.
LOG: Attempting download of new URL file:///C:/GitHub/v44/Web/bin/System.Reactive.Windows.Threading.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.
是什么让 .NET 认为它需要加载这个程序集?
当你说你 "installed" Rx 是什么意思?您使用了哪个 NuGet 包?你的项目有哪些 Rx 引用?确保只使用 Rx-Main
。听起来您可能使用了其中一种包含 Rx-Xaml 的风格(例如 Rx-WPF 或 Rx-Silverlight)。 Rx-Xaml 加载 System.Reactive.Windows.Threading.
http://blogs.msdn.com/b/rxteam/archive/2012/08/15/reactive-extensions-v2-0-has-arrived.aspx 描述了不同的软件包及其包含的内容。
找到了。 因此,我的解决方案中确实没有对反应式扩展的依赖。但是,需要它的旧库仍然留在我的 bin 文件夹中。卸载 nuget 包不会删除它们。 删除 nuget 包后,Clean 似乎不会删除它们。
这是我认为发生的事情。 所以它们位于我的 bin 文件夹中,该文件夹被 git 忽略,因此切换分支不会删除它们。 .NET 在 bin 文件夹中看到它们,尽管不需要它们,但仍会尝试加载它们。我还必须完全清除所有被忽略文件的工作区。
git clean -fxd
从那里开始构建,我很高兴。