Parser Error 是什么错误?
是在调试web service时显示的错误,代码是按照书上给的打下来的, 如下:
<%@ WebService Language = "C#" Class = "ClacService" %>
using System;
using System.Web.Services;
[WebService (Name = "Calculator Web Service", Description = "Performs simple math over the Web")]
class CalcService
{
[WebMethod (Description = "Computer the sum of two integers")]
public int Add ( int a, int b)
{
return a+b;
}
[WebMethod(Description = "Computes the difference between two integers")]
public int Subtract (int a, int b)
{
return a - b;
}
}
在浏览器上输入地址后提示如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not create type 'ClacService'.
Source Error:
Line 1:
Line 2:
Line 3: using System;
Source File: /calc.asmx Line: 1
本人今天才开始学这个玩意,请各位高人指教~