Problem rolling out ADO.Net Data Service application to IIS

后端 未结 3 1564
渐次进展
渐次进展 2021-02-04 08:15

I am adding a ADO.Net Data Service lookup feature to an existing web page. Everything works great when running from visual studio, but when I roll it out to IIS, I get the foll

3条回答
  •  名媛妹妹
    2021-02-04 08:39

    In order to verbosely display the errors resulting from your data service you can place the following tag above your dataservice definition:

    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]  
    

    This will then display the error in your browser window as well as a stack trace.

    In addition to this dataservices throws all exceptions to the HandleException method so if you implement this method on your dataservice class you can put a break point on it and see the exception:

    protected override void HandleException(HandleExceptionArgs e)
    {
      try
      {
        e.UseVerboseErrors = true;
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
      }
    }
    

提交回复
热议问题