Enterprise library

Error when using the RangeValidator in entlib5.

Recently I was working with the enterprise library 5 when I had a strange error.

The error message wasn’t saying anything. “Not a valid value for Int32”.

I searched for a while and found the actual problem.

I think it’s actually some kind of a bug in the enterprise library 5.

In the enterprise library tool you can add a RangeValidator to check if an integer is between a lower and an upper bound.

There is also a possibility to ignore the upper or lower bound.

You should think, if I set the upper bound to ignore the upper bound value is of no meaning anymore.

The problem I discovered is that you still need to give an value for this setting. If you leave the upper bound empty it is perfectly possible to save the file but when you try to use it you will discover that it isn’t working.

So when using the RangeValidator of enterprise library 5, don’t forget to specify the range, even when they are set to ignore.

Leave a Reply

Your email address will not be published. Required fields are marked *