Surya sasidhar
Surya sasidhar

Reputation: 30293

When i am running my application i got error Compilation Error?

When I am running my application, I am getting this erro like this:

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

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class SlideService : System.Web.Services.WebService 

can u help me ?

Upvotes: 0

Views: 370

Answers (2)

Heinzi
Heinzi

Reputation: 172200

As the error message says, you might be missing an assembly reference here. According to the documentation of the System.Web.Script.Services.ScriptServiceAttribute, it's located in System.Web.Extensions.dll, so try adding that to your references.

Upvotes: 1

Oded
Oded

Reputation: 498904

You need to make sure the project this file is in has a reference to the System.Web assembly.

In the Solution Explorer, open the project, right click on the References node and select Add Reference - select the .NET tab and choose the System.Web assembly in order to add it.

If the project already has this reference, you need to ensure that your source file has access to the types defined in it - you do this with a using declaration - add it to the top of your file (assuming C#):

using System.Web;

Upvotes: 1

Related Questions