tags:

views:

15

answers:

2

The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

it gives error in the following line "System.Web.Script.Services.ScriptService"

i have included name space of system.web

A: 

Google is your best friend. MSDN second.

ScriptServiceAttribute Class

Namespace: System.Web.Script.Services

Assembly: System.Web.Extensions (in System.Web.Extensions.dll)

did you add reference to this dll?

Andrey
Intellisense doesnt show script when i write System.Web.
Jaspal
i think i m missing something very basic... as i m new to programming
Jaspal
namespace can span across multiple dll files. you will see Script in in System.Web if you add reference to System.Web.Extensions.dll. If you are very new to programming may be you should start from the beginning, not from advanced tasks? if you want to study .net you should read some books first so this stuff with namespaces and dll is not a mystery for you.
Andrey
thanks a lot... i got ur point friends..adding a reference is done by right clicking on project :pcheers
Jaspal
A: 

Two problems:

  1. The class System.Web.Script.Services.ScriptServiceAttribute exists in the System.Web.Extensions assembly, not System.Web. Make sure you're referencing the System.Web.Extensions assembly in your project.
  2. When referencing an attribute explicitly, you'll need to provide its full name of "ScriptServiceAttribute", and not just "ScriptService".

Once I referenced System.Web.Extensions, the following compiled for me:

System.Web.Script.Services.ScriptServiceAttribute ss;
Michael Petrotta
The type or namespace name 'Extensions' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) was that what u were reffering to michael?
Jaspal
i dont know why i intellisense doesnt show extensions when i write system.web.
Jaspal
@Jaspal - looks like Andrey answered your questions.
Michael Petrotta

related questions