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

  • SEARCH
  • Home
  • 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 3691354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:08:18+00:00 2026-05-19T04:08:18+00:00

I encountered a very annoying change for me from .NET3.5 to .NET4.0. When using

  • 0

I encountered a very annoying change for me from .NET3.5 to .NET4.0.
When using a ExceptionValidationRule on a binding for validating the exception thrown in the bound properties setter gets handled by the binding in 3.5. In 4.0 it is thrown as unhandled while debugging.

Changing the target framework from 3.5->4.0 in this small example (new WPF Application project) shows the problem:

MainWindow.xaml.cs:

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;
        }

        private string _field = "Test";
        public string Property
        {
            get { return _field; }
            set
            {
                if (value.Length < 4)
                    _field = value;
                else
                    throw new ArgumentException();
            }
        }
    }

MainWindow.xaml

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Height="350"
        Width="525">
    <TextBox Width="300"
             Height="100"
             VerticalAlignment="Center"
             HorizontalAlignment="Center"
             Text="{Binding Property, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}" />
</Window>

Is it possible to have these exceptions handled at debug time in .NET4.0?

  • 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-05-19T04:08:19+00:00Added an answer on May 19, 2026 at 4:08 am

    You should use IDataErrorInfo and ValidatesOnDataErrors instead. Not only do you not run into these kinds of situations, but you avoid the tangible performance penalty of bubbling exceptions up the stack.

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

Sidebar

Related Questions

I have encountered a very strange problem in using jQuery load() . I used
I've encountered a very strange issue using JMenuBar where navigating between two JMenus results
I'm using the Coin Slider on my website but encountered a very unexpected surprise
I'm using Entity Framework Migrations & Code First and recently encountered a very weird
I encountered a very slow if statement response using cuda\jacket in matlab. (5 sec
I have encountered a very weird behavior while using SimpleDateFormat for parsing a string
I have encountered a very strange exception. It runs well in here, but my
I've just encountered a very annoying problem while deploying new updates to my website.
I've encountered a very annoying problem while working with Firefox MSAA (). I tried
I encountered a very strange (at least to me) behaviour of a exception class

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.