When i am running my application i got error Compilation Error?
When I am running my application, I am getting this erro like th开发者_开发问答is:
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 ?
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;
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.
精彩评论