Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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:WindowsMicrosoft.NETFrameworkv4.0.21006Microsoft.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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
215 views
Welcome To Ask or Share your Answers For Others

1 Answer

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".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...