System.TypeLoadException: Could not load type 'Facebook.Session.ConnectSession'

Mar 16, 2010 at 9:38 PM
Edited Mar 16, 2010 at 9:46 PM

I am trying to create a new ASP.NET Web Application which will use the Facebook Developer Toolkit.  I've followed the Tutorial and was successfully able to get the sample to work off my local IIS, but when I try to do the same thing in a ASP.NET Web Application, I get the following error when it tries to instantiate the ConnectSession object:

Could not load type 'Facebook.Session.ConnectSession' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'Facebook.Session.ConnectSession' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.


The DLL is in the BIN, and it is not in the GAC (it can't be in the GAC since it's not strongly signed).  I've searched my hard drive and the Facebook.dll is not located anywhere else on my system.  I've tried to add the assembly to the <assemblies>  element in the Web.config but to no avail.

I have also tried not using the Visual Studio Development Server and instead using the Local IIS Web Server and creating a Virtual Directory for the application.  That doesn't seem to work either.

I am compiling under the .NET Framework 3.5, on a 64 Bit machine in Windows 7

Has anyone else encountered this error and can propose a fix for it?  It is also perplexing to me as to why this would work in the Web Site Project (using the Local IIS Web Server) and not in the Web Application Project (using the Visual Studio Development Server).