加载共享类库时出错

时间:2011-12-12 16:45:59

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

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

enter image description here

当我尝试加载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.

这并没有真正提供太多见解。

1 个答案:

答案 0 :(得分:0)

结果是应用程序池设置的“高级设置”部分中的“启用32位应用程序”设置。fix