I am having an ArgumentException with a ResxResourceReader.
I know the file exists, however I can't know if the contents of the file are appropriate (it has a .resx extension but the contents may be rubbish or there can be no contents at all).
The question is how can I check that it is a proper resource file without enumerating it? Since enumerating it with reader.GetEnumerator()
throws the exception.
I've looked at the properties of the reader but didn't see anything that would allow me to do that.
I could do a try and just catch the exception but I want to avoid that if possible.
Any suggestions?
[EDIT] I want to avoid a try-catch specially because on the catch I would be doing the same operation with another resx file, and if that is invalid aswell... well you get what I mean. Though this should seldomly happen.