.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Foundations: Error Handling In Workflows

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

Workflows often define long-running processes and an unhandled failure usually means termination. Avoid this scenario by handling exceptions properly.

Matt Milner

MSDN Magazine February 2009

View Complete Post

More Related Resource Links

Handling 404 page not found with Error page



      How do i handle 404 page not found?

Error while using exception handling block el 4.1


Hi Folks,


i am trying to use tyhe exception handling block of Enterprise library 4.1.


I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.


During runtime I am getting an exception on the HandleException event, The exception is added below:



Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

Foundations: Versioning Workflows


Developers often struggle with versioning workflows and their related classes. Matt Milner discusses the core issues related to workflow versioning and provides recommendations for making changes to workflow definitions, activities, and workflow services.

Matthew Milner

MSDN Magazine May 2009

Foundations: Unit Testing Workflows And Activities


Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

Foundations: ActivityExecutionContext in Workflows


This month Matt Milner explains a critical component in the execution, persistence, and compensation of workflows.

Matt Milner

MSDN Magazine June 2007

Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application


Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004

.NET Exceptions: Make the Transition from Traditional Visual Basic Error Handling to the Object-Orie


If you're used to Visual Basic 6.0 and you're making the transition to Microsoft .NET, you will find that error handling is quite different from what you've used for years. Visual Basic .NET uses a more object-oriented solution to signaling and responding to unexpected problems while your program is running. This approach, called structured exception handling, has a number of advantages over the On Error statements provided in previous versions of Visual Basic. For instance, exceptions give you lots more information about exactly what went wrong in your app. To help you take advantage of this modern error handling paradigm, this article will show you how to raise and respond to exceptions, as well as how to create your own custom exception classes.

Jesse Liberty

MSDN Magazine November 2002

Propagate Error Info: Use ATL and C++ to Implement Error-Handling COM Objects


Predefined error codes returned from HRESULT aren't always much help for debugging COM C++ code. The C++ macros provided with this article produce an XML file listing the error and its context to make debugging easier. This article begins with an overview of error handling in COM, then discusses the COM interfaces used in the macros. It explains how C++ exceptions are caught and converted to COM-compatible error information, how events are logged with the event viewer, and how context is reported in the description string of IErrorInfo. The macros handle logic errors and errors returned by an object or API.

Panos Kougiouris

MSDN Magazine October 2000

Nintex Workflow Error: No workflows are waiting for a BizTalk message [...] No processing has been d



I created a Workflow with Nintex Workflow 2007 (on SharePoint 2007) to send/receive data to BizTalk 2009. It worked fine already. But now I get the following error mesage in the EventViewer:

Nintex Workflow; Build: 11000 (http://ls457/_layouts/nintexworkflow/BiztalkHandler.ashx)
No workflows are waiting for a BizTalk message with message Id of 'GeneralAccessRequest_2010-08-23T15_00_04_44961212B370C554EDFAC41C1201ED6CEFB' on teamsite http://ls457/sites/testapp. No processing has been done.

What could that mean? Any ideas? I definitely changed nothing on the orchestration or BizTalk administration. The BizTalk action sends the data correctly to it's destination (database), but it seems that nintex doesn't receive any return data. I don't think it's a BizTalk problem, because in the BizTalk Message Tracking Database the Message is listet, so it has been sent correctly by BizTalk. But the handler probably has problems to find/receive this message.

Kind regards,


Error handling on Connection Manager Expression

I am using a connection manager with an expression to set the connection string. (see my question http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/1ea71f9a-df5c-4c1c-a2fd-9e24632afbd8) I would like to put some error handling just incase things go wrong. Can anybody give me some tips on where to place error handling?Mr Shaw

What is the correct error handling in custom model binding?

Hello,I am working on a Custom Model Binder where a certain error can occur.When this happens it returns null and a error is added to the ModelState.The problem is that in some projects I am using Fluent Validation and the errors messages I am adding through FV are not taking effect.The message added by the Model Binder always prevails.Should the Model Binder add error messages or just bind the field and return null if some problem happened?What would be the correct implementation for this?Thanks,Miguel

How to : Generic error handling function. Passing GridViewUpdatedEventArgs as EventArgs

Hi, I want to build a generic error handling function for handling inseted, updated, deleted events from formview, gridview and detail view. I am still a bit new to C# so I have encoutered a simple problem that I cannot resolve and cannot find an answer while searching google.Right now I handle error with validator for generic validation but I need to catch BLL error.I have different event handler for the different type of event : protected void FormView_AjoutCompte_ItemInserted(object sender, FormViewInsertedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } protected void GridView_ListeUtilisateurs_RowUpdated(object sender, GridViewUpdatedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } protected void GridView_ListeUtilisateurs_RowDeleted(object sender, GridViewDeletedEventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.ExceptionHandled = true; } } I want to create a generic function that will handle them all, a function such as : private void GestionDerreur(EventArgs e) { if (e.Exception != null) { Afficher_Erreur(e.Exception); e.Exc

Error handling, multiple error messages

Hi all. Have you noticed that sql server catches only last error message? Try to run this: exec('create table #t ( t1 timestamp not null default 0 )') You get: Msg 1755, Level 16, State 0, Line 1 Defaults cannot be created on columns of data type timestamp. Table '#t', column 't1'. Msg 1750, Level 16, State 0, Line 1 Could not create constraint. See previous errors. Now try to run the same thing in try catch: begin try exec('create table #t ( t1 timestamp not null default 0 )') end try begin catch declare @Error varchar(max) set @Error = error_message() raiserror(@Error, 16, 1) end catch The error message this time is: Msg 50000, Level 16, State 1, Line 10 Could not create constraint. See previous errors. Does anyone have any better ideas how to handle sql server errors? Thanks      

Built in "error handling"

We use a SharePoint text field to hold user-entered phone numbers. Occassionaly we find an invalid number such as  (111)23A-5678. Out of the box, does SharePoint offer any way to catch such errors and inform the user to re-enter the data?  (Who likes to have bad data in their system? NOt I for one.) TIA, Barkingdog    

Error in handling Events

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Error handling in a different way

Hey all .. I have actually created a simple database interface for some organization. One feature of the project is to Import data from excel file to sql. I have actually used static query for this. I have defined names of columns;it will import from excel to sql. As Sql tables and fields are also already defined. if user tries to import some file, suppose accidently which has some columns(already defined in query) missing or different, it'd show some error to user. Actual Problem is that these 'errors are not easily understandable for layman or someone who has no idea about the database' for example, if some column name is missing in file being imported, it will show error: 'invalid column name 'abc'' or 'column name missing' .. as abc is defined in Import/Insert query, but sql couldn't find it in file.Now a layman would assume from this error that there's some thing wrong with this column name, and will try to search it in the file, he is trying to import,which will remain missing for him.. : ) Now what i want is 'solution for this problem', Solution i figured out is to check each error and generate custom text for users which is quite hectic. If there's a better dynamic way to import data from excel to sql, then that can also be a solution of this problem. Thanks in advance.

HOWTO: Verify that custom error handling solutions do not expose padding oracle


I've done some digging and come up with what I think is useful information for you if you have a custom error handling solution in place instead of or as well as the usual ASP.NET <customErrors> stuff.

From comments on ScottGu's post it seem to be that the main suspect to be the actual padding oracle is WebResource.axd (possibly other axd's).

  • If you look in .NET Reflector at the IHttpHandler.ProcessRequest method in  System.Web.Handlers.AssemblyResourceLoader there's a call to Page.DecryptString early on.
  • This is the thing that will cause a HTTP 500 status to be returned if it fails, e.g. if the padding, etc in Request.QueryString["d"] is invalid
  • If the attacker manages to get the padding right, then it continues on, ultimately to call throw new HttpException(404...)

It's this differentiation: is the padding correct (404) or not (500) that is at the root of the exploit: the padding oracle.

If your error handling returns exactly the same response for both - it masks the oracle. To test if you're vulnerable externally, a simple test is to request both:

  • webresource.axd?d=foo
  • webre
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend