I recently upgraded an ASP.Net project from MVC 3 to MVC 5, but wanted to keep our old login mechanism. However, when trying to access a restricted page, I was always redirected to /Account/Login instead of /Account/LogOn. I had already met that problem with MVC 3 and thus I had added the following line in my Web.config […]
To iHave or not to iHave
De nos jours, la question est plutôt “To iHave or not to iHave”. Nowadays, the question is more “To iHave or not to iHave”.
[Solved] Wifi connection problems after upgrading to Mountain Lion
After upgrading OS X from Lion to Mountain Lion on my Macbook Pro, I started having serious wifi problems. At first, I would loose my wifi connection once a day, and I could recover it only with a reboot. After trying many different solutions I found in blogs and forums about how to fix wifi problems […]
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 […]
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 = […]
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) […]
Duplicating a database in SQL Server Express
With SQL Server Standard Edition and above, it is easy to copy a database. You simply have to right-click on its name, select Tasks and select Copy Database… However that menu item is not there in SQL Server Express. Googling for a solution, I found a script that does just that, but it was written […]
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 […]
Permission problem to run msdb.dbo.sp_send_dbmail
I needed to be able to send emails from a stored procedure using something like EXECUTE msdb.dbo.sp_send_dbmail @recipients=’address@domainname.com’, @subject = ‘Test email’, @body = ‘Test email body’ The solution was to add the user I was using to run the above query to the msdb database and to assign the role DatabaseMailUserRole to the user: […]
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 […]