views:

48

answers:

1

I tried to throw an InvalidArgumentException in a Silverlight 3 class library, and this type is not available. It doesn't even give me the red underline that tells me it's in a referenced assembly but I just need to import or fully qualify the namespace. Do I have to import a whole other assembly just to get this exception class, or do I have to define my own by this name (or use a less relevant exception class from the choices available)? Why wouldn't this just be available everywhere...it's a pretty universal condition.

+4  A: 

Did you mean to use ArgumentException?

The exception that is thrown when one of the arguments provided to a method is not valid.

InvalidArgumentException appears to live in the Microsoft.SqlServer.ConnectionInfo.dll assemby and I am not sure if that is what you really want.

Andrew Hare
Thank you. From the looks of it, I think I was expecting InvalidArgumentException because I've seen it so much being returned from SQL. ArgumentException is just what I need. =]
Rich