Could not load type 'Facebook.Session.ConnectSession'

May 5, 2010 at 7:18 AM

Hi .. I have referenced the Facebook.dll and Facebook.Web.dll in my VS 2008 project. Everything works well in intellisense during coding time but when I try to run the application I get this error:

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

Now I tried to use other methods with another facebook library and then I get a similar error:

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

This is my code:

        Facebook.Rest.Api Api;
       Facebook.Session.ConnectSession connectSession;

                   connectSession = new Facebook.Session.ConnectSession(ConfigurationManager.AppSettings["ApiKey"], ConfigurationManager.AppSettings["Secret"]);
                   

                    Api = new Facebook.Rest.Api(connectSession);
                    //Api = new Facebook.Rest.Api(null);
                    Facebook.Schema.user loggedInUser = Api.Users.GetInfo(Api.Users.GetLoggedInUser());

Does anyone know why this is happening. It happens when the web applications runs into the create NEW ConnectSession .. it cant load the assembly

Any help would be much appreciated. Thanks. Alan