Search code examples
c#.netexception.net-4.0keynotfoundexception

When KeyNotFoundException is thrown, how do I see which key wasn't found?


A System.Collections.Generic.Dictionary is throwing KeyNotFoundException, but I can't see which key is supposedly missing. How do I determine this?


Solution

  • There is no way to tell this from the exception. You need to implement your own solution for this.