In my case, I had a windows 2003 server and my .net 4.0 console application was placed on the "D" drive and I kept seeping this error when running it (it was trying to connect to a remote WCF service). As soon as I placed the application files on my "C" drive, everything worked. I have no idea why!