
{"id":1129,"date":"2012-11-02T15:48:32","date_gmt":"2012-11-02T19:48:32","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=1129"},"modified":"2012-11-02T15:48:32","modified_gmt":"2012-11-02T19:48:32","slug":"retrieve-the-loaderexception-property-for-more-information","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=1129","title":{"rendered":"Retrieve the LoaderException property for more information&#8230;"},"content":{"rendered":"<p>Here&#8217;s the exception I received today:<\/p>\n<p><code>System.Reflection.ReflectionTypeLoadException. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.<\/code><\/p>\n<p>Isn&#8217;t it lovely? Do the authors think I have a little leprechaun sitting on the user machine and waiting for my command to retrieve <strike>the pot of gold<\/strike> the <code>LoaderException<\/code> property?<\/p>\n<p>And if not, what do they expect my handling for oddball exceptions to be like? Perhaps something like<\/p>\n<p><code><\/p>\n<pre>catch (StrangeExceptionVarietyOne ex)\n{\n    Log(ex.ToString());\n    Log(ex.FunkyPropertyOne);\n}\ncatch (TotallyObscuredExceptionTwo ex)\n{\n    Log(ex.ToString());\n    Log(ex.TotalObscurerAdditionalDataCollection);\n}\ncatch (ReflectionTypeLoadException ex)\n{\n    Log(ex.ToString());\n    foreach (var loaderEx in ex.LoaderExceptions) Log(loaderEx.ToString());\n}\n...<\/pre>\n<p><\/code><\/p>\n<p>Not gonnna happen. A good exception should have everything in its <code>ToString()<\/code>. As in &#8220;<i>for debugging purposes, <code>AggregateException<\/code>&#8216;s <code>ToString<\/code> implementation outputs a string rendering all the contained exceptions<\/i>&#8220;. This is a good exception. This is an exception I like to work with. Why can&#8217;t all exceptions be like that?<br \/>\n<a style=\"display:none\" href=\"http:\/\/www.codeproject.com\/script\/Articles\/BlogFeedList.aspx?amid=1181663\" rel=\"tag\">CodeProject<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s the exception I received today: System.Reflection.ReflectionTypeLoadException. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Isn&#8217;t it lovely? Do the authors <a href=\"https:\/\/ikriv.com\/blog\/?p=1129\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[3,4,5],"tags":[],"class_list":["entry","author-ikriv","post-1129","post","type-post","status-publish","format-standard","category-dotnet","category-hack","category-dev"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1129"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1129\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}