I have created webservice and published it on local machine. Then I have uploaded it on server.
Now while I tried to access webservice it gives following error :
Parser Error Message: Could not create type 'webservice.myservice'
Source Error:
Line 1: <%@ WebService Language="C#" CodeBehind="myservice.asmx.cs" Class="webservice.myservice" %>
I tried This link but unable to solve my problem.
What should I do?
I don’t know if this is dragging something up from the dim and distant past, but I had this problem. I fixed it. So I thought I’d to share it.
When you create a web service in Visual Studio (I’m using 2010 but I’d imagine it’s the same for others), it creates a file called
Service1.asmxYou will be tempted to rename it to
MyService.asmx(or whatever).Then you’ll look inside and see the line
which you’ll change to
and then when you try running it, you get the error
Because it still thinks the class is called Service1.
If you right click the
.asmxfile and select view markup, you’ll see it still says:change it to
save it, try it.
It worked for me.