Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.Extensions Assembly cannot be resolved

Tags:

I am trying to run a .NET 4.0 Console application that references a sister library project (Bar.dll) which itself references System.Web.Extensions in VS2010 B2. I am currently only interested in getting access to System.Web.Scripting.JavaScriptSerializer.

Both projects have references to System.Web.Extensions (using the one listed under ".NET" in the App References dialog), but when I try to compile/run the application, the compiler barks:

C:\Windows\Microsoft.NET\Framework\v4.0.21006\Microsoft.Common.targets(1291,9): warning MSB3253: The referenced assembly "Bar.dll" could not be resolved because it has a dependency on  "System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".

Seriously? What's going on? Why won't the compiler link with the assembly?

like image 613
Frank Krueger Avatar asked Jan 01 '10 02:01

Frank Krueger


1 Answers

currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".                                                          ^^^^^^^^^^^^^^ 

You're targeting the Client Profile, which doesn't include the Web assemblies. Go into Project > Properties > Application and change Target Framework to ".NET Framework 4".

like image 174
itowlson Avatar answered Sep 20 '22 14:09

itowlson