I was working on a sample project today when I encountered this error after adding a new Console Application project to my Visual Studio solution that references other Class Library projects contained in the solution:

The referenced assembly “C:devcenterdotnetpersonalKeithRull.BibliaKeithRull.Biblia.Service.RepositorybinDebugKeithRull.Biblia.Service.Repository.dll” 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. KeithRull.Biblia.ConsoleApp.
There are two possible cause of this error. The first possible reason is when you have an assembly that is referencing System.Web and you try to add that assembly to project that does not have any reference to System.Web (if necessary which most of the time is not). The second possible reason is that your project is using the .NET 4.0 Client Profile which is just a subset of the .NET Framework. Below are the steps that illustrate how to fix this issue.
1. Select your project, right-click and then select “Properties”.

2. The properties tab, change the value for “Target Framework” and then set it’s value to “.NET Framework 4″

Compile your application and that should fix the problem.
Interested in learning more? Below are some useful links if you want to read more about this issue and the .NET 4 Client Profile.
Like this:
Like Loading...