Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

After copying a web site to a 64bit server with IIS 7, I was getting the following error message: Could not load file or assembly ‘PresentationCore’ or one of its dependencies. An attempt was made to load a program with an incorrect format. although everything was working fine when running the site on my machine […]

READ MORE

Output the call stack in C#

Here is the code I use in C# to output the Call Stack. In this example, I am using log4net to output each line in a log file, but it would be possible to use Writeln or another logging library: log4net.ILog logger = log4net.LogManager.GetLogger(“File”); logger.Debug(“Call stack:”); StackTrace st = new StackTrace(true); for (int i = […]

READ MORE

Duplicate a database with SQL Server Express 2008

Following my previous post, here is the same script for SQL Server Express 2008: USE master GO — the original database (use ‘SET @DB = NULL’ to disable backup) DECLARE @DB varchar(200) SET @DB = ‘MyDB’ — the backup filename DECLARE @BackupFile varchar(2000) SET @BackupFile = ‘c:\temp\mydb.dat’ — the new database name DECLARE @TestDB varchar(200) […]

READ MORE

iSync disappeared in OS X Lion

I was really pissed when I realized that iSync had disappeared after upgrading to OS X Lion. Suddenly, I had no mean to synchronize my cellular phone with my computer. I find this type of attitude very rude from Apple. Well, by chance I did not really upgrade. In fact, I installed OS X Lion […]

READ MORE

Unable to turn on or off AirPort solved

Recently, I was unable anymore to turn off AirPort on my Macbook Pro. Other people reported having the same problem, and it seems related to Snow Leopard. Some people had the reverse problem: They were not able to turn on AirPort. Here is the solution that worked for me: Open the following folder: /Library/Preferences/SystemConfiguration Delete these […]

READ MORE