开发者

Referencing log4net in the App_Code folder of an xsp4 hosted ASP.NET application mono

I'm porting an ASP.NET app to mono 2.8.2 using the openSuse 11.3 VM image available on mono-project.com. The app is running it under xsp4. A .cs file in my App_Code folder is not finding log4net.dll which is in the bin folder. I am using the release mono 2.0 version of log4net.dll.

The error I get is below:

Server Error in '/' Application
Compilation开发者_如何学JAVA 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: 

If I try to add a reference explicitly in the web.config file like so:

<compilation debug="true" targetFramework="4.0">
    <assemblies>
        <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" />
    </assemblies>
</compilation>

I get "Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified."


Problem was due to me having both a Bin and a bin folder on the system. The binaries were in bin, but the system was reading Bin first.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜