I have a website where I am using the JSON webservice. I have uploaded my website on the server.
Problem:
When I try to access the webservice it gives me the error as shown in below screenshot. In the below screenshot MyServices is my webservice. MyServices.asmx is the name of the file 开发者_开发问答that I am trying to access.
Troubleshooting that already has been done:
I tried cleaning the bin folder and rebuilding again. But it didn't work.
What could be wrong?
This error might occur if you are using a Web Application type project (in contrast to Web Site) and you have put code in the App_Code
special folder. This folder should be used only with WebSite project types. A Web Application is compiled meaning that all source code is precompiled into an assembly and placed into the bin
folder. On the other hand App_Code
is a special folder. ASP.NET automatically compiles dynamically everything in this folder when the first request arrives so you find yourself with two assemblies that contain the same class.
Visual Studio uses different icons to represent web site and web application which might help you find out which type you are using:
精彩评论