locked
Stack traces/errors not being shown RRS feed

  • Question

  • User-632673987 posted

     Is there any way to ensure validation/other errors are shown by dynamic data?

     I've had some issues which I've managed to fix now with inserting html, fields left null when testing validation etc. which when using webforms would throw an error and give a yellow screen of death. In Dynamic Data these issues just result in clicking 'Insert' or 'Update' on a record appearing to do nothing, making it much harder to debug.

    Tuesday, December 16, 2008 5:37 AM

Answers

  • User-330204900 posted

    The first thing to do when chasing down these kind of error is turn off partial rendering on the  master page

    In site.master change the ScriptManager EnablePartialRendering to false:

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

    Change to

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false" />
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 16, 2008 5:59 AM

All replies

  • User-330204900 posted

    The first thing to do when chasing down these kind of error is turn off partial rendering on the  master page

    In site.master change the ScriptManager EnablePartialRendering to false:

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

    Change to

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false" />
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 16, 2008 5:59 AM
  • User-632673987 posted

     Great, It's showing me a yellow screen of death now but not the source code that caused it. I get the following error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

     

     

    I've checked and the relevant property is set correctly in my web.config file, but I'm still getting the error.

     

    Tuesday, December 16, 2008 6:46 AM
  • User-1005219520 posted

    Setting the debug flag (either approach) enables a good stack trace and full error message - so you have an idea of what caused the bug. It usually results in a pretty good error message. What is the error message and first couple lines of the stack trace.

    Tuesday, December 16, 2008 12:21 PM
  • User-632673987 posted

    I think you've misunderstood me ricka6,

    I've got debug="true" set in my web.config file, but i'm still not getting a stack trace, just the error listed above telling me to set debug="true" in the relevant section of web.config.

    Tuesday, December 16, 2008 12:56 PM
  • User1641955678 posted

    It's strange that there is no stack trace.  Do you see one in the HTML when you View Source in the browser?

    David

    Tuesday, December 16, 2008 3:49 PM
  • User-1005219520 posted

    You've got debug="true" in the wrong place then - you are getting a messege telling where to enable debug. Once you put it in the correct web.config (root directory) in the right place, you will get the error message and stack trace. Until you enable debug correctly, you will get instructions on how to enable it.

    Tuesday, December 16, 2008 6:28 PM
  • User-632673987 posted

     I've double checked web.config and it's definately in the right place. If I delibarately add a compile time error then I can see the code that produced it in the YSOD, it's only when showing an error which is revealed by by setting EnablePartialRendering="false" in Site.Master that I can't see the source code.

    Wednesday, December 17, 2008 5:27 AM
  • User-632673987 posted

    Sorry, just to clarify, I am seeing a stack trace, it's the source code that produced the error I'm not seeing in cases where the error is revealed by setting EnablePartialRendering="false"

    Wednesday, December 17, 2008 5:30 AM
  • User1641955678 posted

    Can you copy the full stack trace in your reply?  Not that whether you see source code or not in the error is unrelated to turning off partial rendering.

    David

    Wednesday, December 17, 2008 1:15 PM
  • User-1005219520 posted

    Also, you don't see the source code if you don't have the source code. If the exception occurs in a DLL - you only get the stack trace and error message, not the source code.

    Wednesday, December 17, 2008 2:07 PM
  • User1641955678 posted

    Rick, not exactly.  Generally, you will see the source code whenever the error occurs in an assembly for which you have both symbols (i.e. the PDB) and sources.  So you can very well get source code in DLLs if the conditions are right.

    But in any case, seeing the stack trace that you're getting will very likely reveal the nature of the error.

    David

    Wednesday, December 17, 2008 2:43 PM