Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all.
my project is a winform project and add reference Facebook.dll and Facebook.Winforms.dll to connect to Facebook API. But it show error

"The referenced assembly "Facebook" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. anothertry"


please help me ! thank you !
Posted

1 solution

Check which assembly .NET framework version your project is and which is the "Facebook.dll"... there seems to be a mismatch,
It is pretty straight forward out of the error message.

E.g. You will have a problem trying to run .NET 4.5 assemblies in a project that targets .NET 4.0
Same goes for running x64 dlls in x86-32 solutions (with a different error message though)

[update]
* Go to the project's properties and select the target framework to be .NET 4.0, not Client Profile
[/update]

Cheers,
Edo
 
Share this answer
 
v3
Comments
smile9x 13-Oct-13 8:49am    
i use .Net 4.0 and have used newest version Facebook and Facebook.Winform but it until show error
Joezer BH 13-Oct-13 9:15am    
Which version (of .NET) is the Facebook.dll compiled for?
smile9x 13-Oct-13 12:33pm    
Facebook version is 6.0.10.0
smile9x 13-Oct-13 12:57pm    
and it show
Warning 1 The referenced assembly "Facebook.Winforms" could not be resolved because it has a dependency on "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. WindowsFormsApplication1
Joezer BH 15-Oct-13 2:14am    
See update in the solution,
I hope that's the issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900