Showing posts with label .NET Framework. Show all posts
Showing posts with label .NET Framework. Show all posts

Tuesday, February 17, 2015

log4net AdoNetAppender stops logging / does not recover if database connection is lost / database is down, ReconnectOnError

I use the Apache log4net AdoNetAppender to log information from my application into a SQL database. In case, the network connection to the database is lost or the database is down for some reason, the AdoNetAppender quits logging (forever) to the database and does not recover even if the database is online again.

How-I-fixed-it:
I found the right hints here:
https://www.mail-archive.com/log4net-user@logging.apache.org/msg04655.html
http://logging.apache.org/log4net/release/sdk/log4net.Appender.AdoNetAppender.ReconnectOnError.html

Add the tag:

to the log4net XML config file:



   


Keep in mind, that it then tries to reconnect to the database until the connect times out. This blocks the thread of the application!

You can add:
Connect Timeout=1 to the connectionString  property to Limit the blocking to 1 second:
   
   
   
  



   
   
   
   
  

Friday, September 26, 2014

Visual Studio 2010 wont start after uninstall .NET-Framework 4.5 / Unknwon error

I did some tests with .NET-Framework 4.5 on my computer. After uninstalling it, i recognized, my Visual Studio 2010 does not start any more. It shown an "Unkonwn error" message box at startup an then closes again.

How-I-fixed-it:
I found out, that uninstalling .NET 4.5 also uninstall .NET Framework 4. I re-installed .NET 4 from http://www.microsoft.com/de-de/download/details.aspx?id=17718 and Visual Studio was working fine.

I found the right hints here:
http://chanmingman.wordpress.com/2012/05/10/unknown-error-to-prevent-vs-2010-from-start-after-uninstall-vs-11-beta/