4
votes

If I create a brand new Website project using Visual Studio 2010 dot net 4.0 I get this error message if I try to add "using System.Web.Extensions".

The type or namespace name 'Extensions' does not exist in the namespace 'System.Web'

I do not get the error if I create a website using dot net 3.5

Any searching I have done suggest changing from target platform 4.0 Client Profile to just plain 4.0

But I don't have Client Profile as an option and C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.Extensions.dll is on my PC.

Any ideas?

1
Did you add the dll as a reference to the project?RJ Cuthbertson
There is no namespace System.Web.Extensions in System.Web.Extensions.dll. Why do you need this namespace for?Amiram Korach
can you post a screen shot of your project properties, where the target profile is displayed? I have had this same problem many times and it has always been target platform. Might be worth a second look.Shai Cohen

1 Answers

4
votes

You need to add a reference to System.Web.Extensions in order to use it in your project.

Adding System.Web.Extensions