2 minutes to read read

There are a plenty of logging tools and options in todays market but the userful are some. Almost all of them if not some do work on similar baseline, a set of rules to route and a sink to put in the logs. Some are really cool but have lost their sharpness with the low or no community updates like log4net which had been a great library for logging almost anything with .net. Some other good stuff like in the “Microsoft.Practices” namespace are also good but do have a good learning curve.

At this point NLog comes out as a wonderful logger with lowest learning curve, fastest adaption, small footprint, async support, and a large set of targets that can fulfill almost all requirement. With these set of articles, I shall try to put how easy it is to employe the hardlifting of logging in your projects. For this post, we shall take out lovely Simple Console Application. The download link for sample code can be found at the end of the post. Also note we are not using any abstract or patterns, this is just to demonstrate a brief purpose.

So, We first created the the Default Console Application Project with all default settings. And the we did a nuget install for nlog. This shall install the latest version of the package to project.

Install-Package NLog

Once we have this, we are pretty good to start. Second Step Continue reading

< 1 minute to read

Just another day with Windows 10 and got restoring my TFS Server. This has been a very common error and perhaps the first thing you see when you browse to your tfs page after restoring the database.

Critcal error: TF30046: The instance information does not match. Team Foundation expected 50623DA5-2C61-42F3-B57B-D1145C16B187 which was not found. Please contact your Team Foundation Server administrator.

The reason for this is very simple. Each TFS installation has an installation instance ID that is mapped to vertual application id setup. So what is happening here is that the Virtual Web application is looking for a new TFS instance Id which is basically a GUID. But we have restored older database. So perhaps we have the following option as sure and simple solution.

  1. Open Database instance in Sql Server Management Studio and open database TFS_Configuration
  2. Go to tbl_ServiceHost table and look for entry where Name  = “TEAM FOUNDATION”. Copy the HostId
  3. Go to TFS INSTALL FOLDER \Application Tier\Web Services folder
  4. Open the web.config and update the value for applicationId  key with the value copied in step 2
  5. Restart the IIS for application tier virtual application
  6. You are good to go…