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。

相關問題