Click here to Skip to main content
15,881,413 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=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' ".. I'm using CR 2008.

C#
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=1.2.10.0, 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
Posted
Updated 21-Feb-21 22:59pm
v3

Make sure that log4net.dll (specifically the 1.2.10.0 version with that public key) exists beside your application or is in the assembly cache (GAC).
 
Share this answer
 
Comments
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 http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_5.exe[^]
 
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=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' [^]
 
Share this answer
 
v2
Check weather your Bin folder contains the log4net dll referenced.
IF it is referenced then check the config file and make sure
XML
<configsections>
   <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net,Version=1.2.10.0, Culture=neutral, PublicKeyToken=1B44E1D426115821" />
 </configsections>

XML
<log4net>
    <!-- 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" />
      </layout>
      <filter type="log4net.Filter.LevelRangeFilter">
        <levelmin value="INFO" />
        <levelmin value="DEBUG" />
        <levelmax value="ERROR" />
      </filter>
    </appender>
    <!-- Define some output appenders -->
    <appender name="RSServiceConsoleAppender" type="log4net.Appender.ConsoleAppender">
      <mapping>
        <level value="ERROR" />
        <forecolor value="Red" />
      </mapping>
      <mapping>
        <level value="DEBUG" />
        <forecolor value="HighIntensity" />
      </mapping>
      <mapping>
        <level value="INFO" />
        <forecolor value="Green" />
      </mapping>
      <mapping>
        <level value="WARN" />
        <forecolor value="Yellow" />
      </mapping>
      <mapping>
        <level value="FATAL" />
        <forecolor value="White" />
        <backcolor value="Red" />
      </mapping>
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c %m%n" />
      </layout>
      <filter />
    </appender>
    <!-- Setup the root category, add the appenders and set the default level
             ALL
             DEBUG
             INFO
             WARN
             ERROR
             FATAL
             OFF
          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.-->
    <root>
      <level value="ALL" />
      <appender-ref ref="RSServiceFileLogAppender" />
    </root>
  </log4net>
 
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=1.2.10.0 be
Instead in the global assembly cache gac frist
 
Share this answer
 
Comments
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)



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