Exception

Aug 5, 2009 at 2:19 PM

Hi,

I am trying to create a desktop app in vb.net.

 

So far all I have done is add the FacebookService via the toolbox and a friends list/map then hook it up as per the sample in the documentation however it never gets that far as I get this error when trying to run it:

 

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load type 'facebook.Components.FacebookService' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
  Source="Facebook"
  StackTrace:
       at Facebook.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190    at Facebook.My.MyProject.MyForms.get_frmTemp()    at Facebook.frmTemp.Main() in C:\Users\Ian\Documents\Visual Studio 2008\Projects\HomeAgent\Facebook\frmTemp.Designer.vb:line 2    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.TypeLoadException
       Message="Could not load type 'facebook.Components.FacebookService' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
       Source="Facebook"
       TypeName="facebook.Components.FacebookService"
       StackTrace:
            at Facebook.frmTemp.InitializeComponent()    at Facebook.frmTemp..ctor()
       InnerException: 

 

 

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Could not load type 'facebook.Components.FacebookService' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
  Source="Facebook"
  StackTrace:
       at Facebook.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190    at Facebook.My.MyProject.MyForms.get_frmTemp()    at Facebook.frmTemp.Main() in C:\Users\Ian\Documents\Visual Studio 2008\Projects\HomeAgent\Facebook\frmTemp.Designer.vb:line 2    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.TypeLoadException
       Message="Could not load type 'facebook.Components.FacebookService' from assembly 'Facebook, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
       Source="Facebook"
       TypeName="facebook.Components.FacebookService"
       StackTrace:
            at Facebook.frmTemp.InitializeComponent()    at Facebook.frmTemp..ctor()
       InnerException: 

 

 

Any thoughts?

 

 

Aug 5, 2009 at 3:46 PM

Please share the lines of code that are causing exception.

 

Aug 6, 2009 at 11:09 AM

there aren't any. i removed all code from the project.

all it is now is 1 form with a FacebookService component added, I put in my api key & secret.

Then as soon as I run the project I get that exception

Aug 6, 2009 at 11:27 PM

Probably you have to right click on the project, select, "Add Reference" and add a reference to "Facebook.dll", "facebook.desktop.dll" and "facbeook.web.dll" files?

Aug 7, 2009 at 12:40 AM

Tried that as well, this is quite bizare..

Aug 7, 2009 at 6:12 AM

Look if you can possible email me the sample project that is not working or ftp somewhere? I don't think that's a problem with the toolkit provided here. Hundreads of people are using it gracefully.

Usman

Email: passing.thoughts (at) yahoo (dot) com

Aug 7, 2009 at 3:16 PM

Check your config file.  Missing dlls referenced in there will cause that sort of error