Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:09:47+00:00 2026-06-01T08:09:47+00:00

Short version: Why does Visual Studio tell me that the code has thrown a

  • 0

Short version:

Why does Visual Studio tell me that the code has thrown a user-unhandled exception, even though I catch the exception?

Longer version:

I’m using Entity Framework together with Microsoft’s transient fault handling framework:

My Entity Framework class is partial, and I have my own method SaveChangesWithRetries where I perform the retry-logics:

public partial class EfContext
{
    public virtual void SaveChangesWithRetries()
    {
       var retryPolicy = RetryPolicyFactory.GetDefaultSqlCommandRetryPolicy();
       retryPolicy.ExecuteAction(() =>
                       {
                          SaveChanges();
                       });
    }
 }

My code which uses this function may look as follows:

try
{
    context.SaveChangesWithRetries();
}
catch (OptimisticConcurrencyException)
{
    continue;
}

Even though I catch the OptimisticConcurrencyException exception, Visual Studio stops the debugger and tell me that the call to ExecuteAction() threw an user-unhandled exception. When this happens, the debugger stop within the EfContext class. If I press F10, the debugger moves to the catch (OptimisticConcurrencyException).

I don’t understand why VS2010 tells me that there was a user-unhandled exception even though I have a catch and even though my catch catches the exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:09:48+00:00Added an answer on June 1, 2026 at 8:09 am

    Figured out what was causing this.

    1. Our code started a try/catch clause
    2. Our code called Transient Fault Handling Framework (TFHF)
    3. TFHF called our code (via lambda expression9
    4. Our code threw exception

    Since TFHF was built in release, the .NET Framework did not understand that our own code catched the exception in step 0, which was thrown in step 3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short version: $count in the code below seems to be 0 even when it
The short version is that I have a protocol which has an optional parameter.
Short version: I need mysql code that will change [href=http://a-random-domain.com]hyperlink[/href] into <a href=http://a-random-domain.com>hyperlink</a> without
Short Version : What does this (hex?) code found in onesixtyone mean? char object[]
Short version: I'm trying to determine the best way to track what the user
I just installed Visual Studio 2010 yesterday. As part of that I installed VSTO
Short version (if you can answer the short version it does the job for
Short version: I'm extending a jQuery object function that is intended to take 0-3
Short Version I have a list of int s that I need to figure
Short Version: Does anyone know how to do a simple date insert using Doctrine2?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.