我正在使用mono-project.com上提供的openSuse 11.3 VM映像将ASP.NET应用程序移植到mono 2.8.2。该应用程序在xsp4下运行它。我的App_Code文件夹中的.cs文件找不到bin文件夹中的log4net.dll。我正在使用发布mono 2.0版本的log4net.dll。
我得到的错误如下:
Server Error in '/' Application
Compilation Error
Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: CS0246: The type or namespace name `log4net' could not be found. Are you missing a using directive or an assembly reference?
Source Error:
Line 2: using System.Web;
Line 3: using System.Web.SessionState;
Line 4: using log4net;
Line 5: using MongoDB.Bson;
Line 6:
如果我尝试在web.config文件中显式添加引用,如下所示:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
</assemblies>
</compilation>
我得到“无法加载文件或程序集”log4net,Version = 1.2.10.0,Culture = neutral,PublicKeyToken = 1b44e1d426115821'或其中一个依赖项。系统找不到指定的文件。“
答案 0 :(得分:1)
问题是由于我在系统上同时拥有Bin和bin文件夹。二进制文件在bin中,但系统首先读取了Bin。