【问题标题】:Error loading shared class library加载共享类库时出错
【发布时间】:2011-12-12 16:45:58
【问题描述】:

我有一个 ASP.NET 站点/WPF/Windows 手机应用程序,它们都使用三个链接项目。在数据项目 (Myproject.DAL) 中,我使用了对 System.Data.SQLiteICSharpCode.SharpZipLib 的引用。后者似乎是为 VS 中的运行时版本 2.0 编译的,即使我下载的是 4.0 版本(可能是我的误解)。

当我尝试加载 ASP.NET 4 站点时,出现错误:

Could not load file or assembly 'ChickenPing.DAL' or one of its dependencies. An attempt was made to load a program with an incorrect format.

我记得过去遇到过这个问题,它是由 System.Data.SQLite 库引起的,它是一个 x86 二进制文件。我已经更新了,这绝对不是原因。所有项目都设置为作为 .NET 4 x86 运行。有什么办法可以找出造成这种情况的实际原因吗?我猜肯定是某个地方的 DLL 有问题,但 MSBuild 似乎没有报告任何问题。

尽管打开了 Fusion 日志记录,但我得到的唯一神秘错误是:

=== Pre-bind state information ===
LOG: User = IIS APPPOOL\CP
LOG: DisplayName = ChickenPing.DAL
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: ChickenPing.DAL | Domain ID: 9
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/echilon/Documents/CP/
LOG: Initial PrivatePath = C:\Users\echilon\Documents\CP\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\echilon\Documents\CP\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\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/v4.0.30319/Temporary ASP.NET Files/root/7bfa5a6e/c6574e91/ChickenPing.DAL.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/7bfa5a6e/c6574e91/ChickenPing.DAL/ChickenPing.DAL.DLL.
LOG: Attempting download of new URL file:///C:/Users/echilon/Documents/CP/bin/ChickenPing.DAL.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

这并没有真正提供太多洞察力。

【问题讨论】:

    标签: asp.net .net wpf compilation compiler-errors


    【解决方案1】:

    这原来是一个设置——在应用程序池设置的“高级设置”部分中的“启用 32 位应用程序”。

    【讨论】:

      猜你喜欢
      • 2011-05-29
      • 2017-11-05
      • 2014-12-09
      • 2022-01-04
      • 2016-10-26
      相关资源
      最近更新 更多