Click here to Skip to main content
15,614,421 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hello when i'm attempting to run my .net application it's say's "Could not load file or assembly 'log4net, Version=, Culture=neutral, PublicKeyToken=692fbea5521e1304' ".. I'm using CR 2008.

Line 51:assembly=CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304
Line 52:assembly=CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304
Line 53:add assembly=log4net, Version=, Culture=neutral, PublicKeyToken=692FBEA5521E1304
Line 54:ssembly=CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304
Line 55: assembly=CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304
Updated 21-Feb-21 22:59pm

Make sure that log4net.dll (specifically the version with that public key) exists beside your application or is in the assembly cache (GAC).
Share this answer
Madhav Gunjal 2-Jan-16 5:01am    
what if log4net.dll is not exist at production machine??how to install or config the same file on production machine??
Mehdi Gholam 2-Jan-16 5:09am    
Just copy the file beside your exe on the production machine.
Madhav Gunjal 2-Jan-16 5:22am    
it means I simpy suppose to compy log4net file from my development machine from windows/assembly foldr to production machine??
after i install CR Run time my problem was solved..i think the matter was between the 32bit and 64bit version.

here is the link[^]
Share this answer
Check whether the log4net.dll is available in the BIN folder & also check the version of it referenced.

Could not load file or assembly 'log4net, Version=, Culture=neutral, PublicKeyToken=692fbea5521e1304' [^]
Share this answer
Check weather your Bin folder contains the log4net dll referenced.
IF it is referenced then check the config file and make sure
   <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net,Version=, Culture=neutral, PublicKeyToken=1B44E1D426115821" />

    <!-- Define some output appenders -->
    <appender name="RSServiceFileLogAppender" type="log4net.Appender.RollingFileAppender">
      <file value="C:\RSService\RSServiceLogs_" />
      <staticlogfilename value="false" />
      <appendtofile value="true" />
      <rollingstyle value="Date" />
      <datepattern value="yyyy-MM-dd.LOG" />
      <lockingmodel type="log4net.Appender.FileAppender+MinimalLock" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d %-5p %m%n" />
      <filter type="log4net.Filter.LevelRangeFilter">
        <levelmin value="INFO" />
        <levelmin value="DEBUG" />
        <levelmax value="ERROR" />
    <!-- Define some output appenders -->
    <appender name="RSServiceConsoleAppender" type="log4net.Appender.ConsoleAppender">
        <level value="ERROR" />
        <forecolor value="Red" />
        <level value="DEBUG" />
        <forecolor value="HighIntensity" />
        <level value="INFO" />
        <forecolor value="Green" />
        <level value="WARN" />
        <forecolor value="Yellow" />
        <level value="FATAL" />
        <forecolor value="White" />
        <backcolor value="Red" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
      <filter />
    <!-- Setup the root category, add the appenders and set the default level
          For example, setting the threshold of an appender to DEBUG will also allow INFO,
          WARN, ERROR and FATAL messages to log along with DEBUG messages. (DEBUG is the
          lowest level). This is usually acceptable as there is little use for DEBUG
          messages without the surrounding INFO, WARN, ERROR and FATAL messages.
          Similarly, setting the threshold of an appender to ERROR will filter out DEBUG,
          INFO and ERROR messages but not FATAL messages.-->
      <level value="ALL" />
      <appender-ref ref="RSServiceFileLogAppender" />
Share this answer
In my case, the solution was to edit my application pool settings in IIS for the relevant application pool.

Under Advanced Settings, I changed the Enable 32-Bit Applications setting to True.
Share this answer
assembly log4net version= be
Instead in the global assembly cache gac frist
Share this answer
CHill60 29-May-18 9:16am    
The question was answered 4 years ago and you have added nothing new (nor legible) to the thread
Make sure that all of your dependencies are using the same version of log4net -- in my case, I had one dependency using 2.0.8 and another using 2.0.11 which caused this.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900