I'm not sure how to present this problem, but I've created a web service that returns XML to the user, and while debugging, on all errors, all I receive is this exact text in the web browser:
An error occurred on the server.
In every other C# application I've created over the years, errors break within the code. Obviously, this makes it very difficult to debug code, especially when the error happens prior to any code being entered.
I really don't know where to look.
I searched my solution for this text, and it doesn't exist in any of my files.
web.config contains:
<system.web>
<customErrors mode="Off" />
<webServices>
<diagnostics suppressReturningExceptions="true" />
<protocols>
<add name="HttpSoap" />
<add name="HttpPost" />
<add name="HttpGet" />
</protocols>
</webServices>
I checked global.asax and it seems normal:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
The webservice class itself starts off like this:
[WebService(Namespace = "http://CarReports.org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class CarService : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
public CarOptionsModel CurrentOptions(string serialNo)
{
...
}
I really don't know where else to look, and Googling "An error occurred on the server." is impossible.