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