2011-01-30 52 views
1

我正在使用mono-project.com上的openSuse 11.3 VM镜像将单个2.8.2的ASP.NET应用程序移植到单声道。该应用程序正在xsp4下运行它。我的App_Code文件夹中的.cs文件未找到位于bin文件夹中的log4net.dll。我正在使用log4net.dll的发行单声道2.0版本。在xsp4托管的ASP.NET应用程序的App_Code文件夹中引用log4net mono

我得到的错误是如下:

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'或其依赖项之一,系统找不到指定的文件。

回答

1

问题是由于我在系统上同时拥有Bin和bin文件夹。二进制文件在bin中,但系统首先阅读Bin。

相关问题