dit: After seeing some of the responses to the main response, my suggestion continues with
- Add more Try/Catch Blocks to the code.
- Put in more check for null variables and lists
- Put in more error handling. Do a divide and conquer strategy for this situation. Determine where the errors reside and start putting in error handling, logging and general plumbing to facilitate better code.
Debugging Deployed Web Applications
If you need to debug a Web application that is running on a production server, this should be done with caution. If you attach to the ASP.NET worker process for debugging and hit a breakpoint, for example, all managed code in the worker process halts. Halting all managed code in the worker process can cause a work stoppage for all users on the server. Before you debug on a production server, consider the potential impact on production work.
To use Visual Studio to debug a deployed application, you must attach to the ASP.NET worker process and make sure that the debugger has access to symbols for the application. You must also locate and open the source files for the application. For more information, see Specify Symbol (.pdb) and Source Files in the Visual Studio Debugger, How to: Find the Name of the ASP.NET Process, and ASP.NET Debugging: System Requirements.
Note |
---|
Many ASP.NET Web applications reference DLLs that contain business logic or other useful code. Such a reference automatically copies the DLL from your local computer to the \bin folder of the Web application's virtual directory. When you are debugging, remember that your Web application is referencing that copy of the DLL and not the copy on your local computer.
|
The process for attaching to the ASP.NET worker process is the same as attaching to any other remote process. When you are attached, if you do not have the correct project open, a dialog box appears when the application breaks. This dialog box asks for the location of the source files for the application. The file name that you specify in the dialog box must match the file name specified in the debug symbols on the Web server. For more information, see Attach to Running Processes with the Visual Studio Debugger.
Tracing in asp.net - Part 79
Tracing enables us to view diagnostic information about a request and is very useful when debugging application problems.
Tracing can be turned on or off
1. At the application level or
2. At the page level
To enable tracing at the application level set "trace" element's "enabled"attribute to "true" in web.config. This enables tracing for all pages in the application.
<trace enabled="true"/>
To disable tracing for specific pages, set Trace="false" in the webform's "Page" directive
<%@ Page Language="C#" Trace="false" AutoEventWireup="true"CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
1. At the application level or
2. At the page level
To enable tracing at the application level set "trace" element's "enabled"attribute to "true" in web.config. This enables tracing for all pages in the application.
<trace enabled="true"/>
To disable tracing for specific pages, set Trace="false" in the webform's "Page" directive
<%@ Page Language="C#" Trace="false" AutoEventWireup="true"CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
http://csharp-video-tutorials.blogspot.com/2012/12/writing-custom-aspnet-tracing-messages.html
https://www.youtube.com/watch?v=q8iGrvcKjmc&list=PL6n9fhu94yhXQS_p1i-HLIftB9Y7Vnxlo&index=81
No comments:
Post a Comment