Easy way to generate “System.InvalidOperationException: Nullable object must have a value.”
Posted by jpluimers on 2016/07/07
Easy way to generate “System.InvalidOperationException: Nullable object must have a value.”.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| public class Test | |
| { | |
| public static void Main() | |
| { | |
| int? nullableInt = null; | |
| int nowInt = (int)nullableInt; | |
| } | |
| } |
–jeroen






Leave a comment