Click here to Skip to main content
15,886,919 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: AllowPartiallyTrustedCallers not working on Shared Assembly Pin
Dave Kreskowiak21-Aug-09 5:15
mveDave Kreskowiak21-Aug-09 5:15 
GeneralRe: AllowPartiallyTrustedCallers not working on Shared Assembly Pin
Tristan Rhodes23-Aug-09 22:56
Tristan Rhodes23-Aug-09 22:56 
RantThrow it like you mean it... Pin
Adriaan Davel21-Aug-09 1:32
Adriaan Davel21-Aug-09 1:32 
GeneralRe: Throw it like you mean it... Pin
Dave Kreskowiak21-Aug-09 2:19
mveDave Kreskowiak21-Aug-09 2:19 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel21-Aug-09 2:38
Adriaan Davel21-Aug-09 2:38 
GeneralRe: Throw it like you mean it... Pin
Dave Kreskowiak21-Aug-09 4:08
mveDave Kreskowiak21-Aug-09 4:08 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel25-Aug-09 19:35
Adriaan Davel25-Aug-09 19:35 
GeneralRe: Throw it like you mean it... Pin
Dave Kreskowiak26-Aug-09 1:56
mveDave Kreskowiak26-Aug-09 1:56 
Adriaan Davel wrote:
if the message was "Argument 'asd' is out of range, maximum value is '32767'" it probably would have shaved 3 hours off my debugging.


And if the object doesn't have a string representation?? Also, how is the exception going to know what the possible values are for a property that doesn't have "values"??

You want the exception to tailor itself to the property it's throw in and that's just not practical. The exception that MS provides works in the widest array of cases possible, where your exception message only works where a property is a value type.


Adriaan Davel wrote:
I'm of the opinion that if you are going to suggest solutions make sure you understand the problem


I do understand the problem, and what it would take to get an exception to do what you want.


The point is, if you want a more meaningful message, wrap the property in it's own exception handler and throw a more meaningful message yourself, then catch that exception in your presentation layer.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Throw it like you mean it... Pin
Adriaan Davel30-Aug-09 19:15
Adriaan Davel30-Aug-09 19:15 
GeneralRe: Throw it like you mean it... PinPopular
Gideon Engelberth21-Aug-09 3:53
Gideon Engelberth21-Aug-09 3:53 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel25-Aug-09 19:19
Adriaan Davel25-Aug-09 19:19 
GeneralRe: Throw it like you mean it... Pin
supercat925-Aug-09 5:25
supercat925-Aug-09 5:25 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel25-Aug-09 19:40
Adriaan Davel25-Aug-09 19:40 
GeneralRe: Throw it like you mean it... Pin
supercat926-Aug-09 5:40
supercat926-Aug-09 5:40 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel30-Aug-09 19:33
Adriaan Davel30-Aug-09 19:33 
GeneralRe: Throw it like you mean it... Pin
supercat931-Aug-09 5:11
supercat931-Aug-09 5:11 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel31-Aug-09 19:30
Adriaan Davel31-Aug-09 19:30 
GeneralRe: Throw it like you mean it... Pin
Adriaan Davel31-Aug-09 0:39
Adriaan Davel31-Aug-09 0:39 
QuestionRecognizing an object instance after regenerating dinamicly the assembly Pin
Mehdi_S21-Aug-09 0:06
Mehdi_S21-Aug-09 0:06 
QuestionKeeping Command Console Open After Running Process Pin
Tristan Rhodes20-Aug-09 23:45
Tristan Rhodes20-Aug-09 23:45 
AnswerRe: Keeping Command Console Open After Running Process Pin
Alan N21-Aug-09 7:38
Alan N21-Aug-09 7:38 
AnswerRe: Keeping Command Console Open After Running Process Pin
qmartens22-Aug-09 19:46
qmartens22-Aug-09 19:46 
GeneralRe: Keeping Command Console Open After Running Process Pin
Alan N23-Aug-09 7:08
Alan N23-Aug-09 7:08 
GeneralRe: Keeping Command Console Open After Running Process Pin
Tristan Rhodes23-Aug-09 22:59
Tristan Rhodes23-Aug-09 22:59 
Questionautopositioning in visual studio 2008 Pin
myinstincts20-Aug-09 21:28
myinstincts20-Aug-09 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.