views:

104

answers:

2
System.InvalidOperationException:Värdet null kan inte tilldelas en medlem av typen System.Boolean eftersom den är en värdetyp som inte kan ha värdet null.

Thank you Microsoft, intentions are good, I know. As if anybody who really finds this information useful would also consider Swedish as the coding lingua franca. The Moldavians can just turn to Moldavian StackOverflow and post their queries for speedy help.

Does anybody know how to get these messages in English?

A: 

Google translate gives us:

The value null can not be awarded to a member of type System.Boolean because it is a value type that can not be null value.

Edit: Event though this translation is not perfect it gives us a good idea of the problem. Here is my transalatio nof the translation ;-)

The value null cannot be assigned to a member of type System.Boolean because it is a value type that cannot be a null value.

For the record, I think only the Nullable<> value type can be assigned a null value.

Marcel Gosselin
Oops, maybe I accidentally overloaded the awarding operator.
Martin
No. The problem is Microsoft in this instance, but that's secondary to the question, which has a question mark, see above.
Martin
+1  A: 

The exception messages are controlled by the thread's culture. You can find some workaround suggestions here.

jarnbjo
There doesn't seem to be any great solutions to this. I'll just wait see if there has been any developments before giving you the accept.
Martin
No, the workarounds are not always useful. The problem is that the Exception class only has a single "Message" property, which according to the API documentation gives culture dependent details, at least for the .NET framework exceptions. Java on the other side has both a message and a localized message in the Throwable base class for exceptions, but unless overridden in a specific implementation, they map to the same internal value.
jarnbjo
Thanks for your input.
Martin