{"id":9,"date":"2008-07-21T12:43:00","date_gmt":"2008-07-21T16:43:00","guid":{"rendered":"http:\/\/everysport.net\/GamePlan3\/Default.aspx?tabid=489&amp;EntryID=9"},"modified":"2008-09-18T16:39:08","modified_gmt":"2008-09-18T20:39:08","slug":"debugging-difficult-exceptions-in-dotnetnuke","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/2008\/07\/21\/debugging-difficult-exceptions-in-dotnetnuke\/","title":{"rendered":"Debugging Difficult Exceptions in DotNetNuke"},"content":{"rendered":"<p>During my time working with DotNetNuke, I have encountered <a href=\"http:\/\/www.dotnetnuke.com\/Community\/Forums\/tabid\/795\/body\/stacktrace\/subject\/stacktrace\/scope\/threadsearch\/Default.aspx\"><span style=\"color: #669966\">innumerable forum posts<\/span><\/a> in the following general form:<\/p>\n<blockquote><p><span style=\"font-family: Courier\">I&#8217;m getting a very vague general exception error, and I&#8217;m not sure what is causing it.\u00a0 There doesn&#8217;t seem to be anything visible in the application\u00a0. . . [and] no errors as I&#8217;m navigating the site. Any and all help is greatly appreciated!<\/span><\/p>\n<p><span style=\"font-family: Courier\"><strong>StackTrace<\/strong>: <\/span>[NullReferenceException: Object reference not set to an instance of an object.]<br \/>\n\u00a0\u00a0 DotNetNuke.UI.Skins.SkinDefaults..ctor(SkinDefaultType DefaultType) +189<br \/>\n\u00a0\u00a0 DotNetNuke .Common.Globals.get_DefaultSkin() +31<br \/>\n\u00a0\u00a0 DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings(Int32 TabId, PortalAliasInfo objPortalAliasInfo) +2797<br \/>\n\u00a0\u00a0 DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo objPortalAliasInfo) +82<br \/>\n\u00a0\u00a0 DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) +3303<br \/>\n\u00a0\u00a0 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92<br \/>\n\u00a0\u00a0 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64<\/p><\/blockquote>\n<p><span style=\"font-family: tre\">Experienced DNN developers will recognize the general area in which the error is occurring (missing skinningDefaults in DotNetNuke.config) and probably some general guidance to rectify the error (check that DotNetNuke.config exists, and correctly contains the proper skinningDefaults element).<\/span><\/p>\n<p>This is fine for exceptions that occur frequently, but how does an experienced developer guide a novice in finding a solution to this issue?<\/p>\n<blockquote>\n<pre>[NullReferenceException: Object reference not set to an instance of an object.]\r\n   DotNetNuke.HttpModules.UrlRewriteModule.RewriteUrl(HttpApplication app) +378\r\n   DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) +1180\r\n   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92\r\n   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64<\/pre>\n<\/blockquote>\n<p>Even a sophisticated developer would need to explore several avenues in finding a solution.\u00a0 Assisting a relatively novice forum user in performing these tasks is problematic &#8212; such assistance would require a number of back-and-forth exchanges.\u00a0 With regret, I unfortunately observe many problems go unremedied for this reason (as, to date, is the exception <a href=\"http:\/\/www.dotnetnuke.com\/Community\/Forums\/tabid\/795\/forumid\/107\/threadid\/243084\/scope\/posts\/Default.aspx\"><span style=\"color: #669966\">posted<\/span><\/a> immediately above).<!--more--><\/p>\n<h3>A Better Way to Debug<\/h3>\n<p>Clearly, for difficult-to-diagnose problems, a call stack is not sufficient to identify a solution.\u00a0 Fortunately, there is a relatively easy way to augment this stack with information that greatly aids in diagnosis &#8212; assemblies with debugging symbols.\u00a0 A debug build provides line numbers that may be used to target with much greater accuracy the particular problem that a user is experiencing.\u00a0<\/p>\n<p>For a non-developer experiencing a difficult problem, he or she could replace existing production-build assemblies with their debug-symbol counterparts, reproduce the error, and post the augmented call stack for analysis.\u00a0 I argue that this would (a) significantly increase error resolution, and (b) decrease debug time per issue for both assistor and assistee.<\/p>\n<p>Unfortunately, at this time the DNN team seems to have <a href=\"http:\/\/www.dotnetnuke.com\/Community\/Forums\/tabid\/795\/forumid\/118\/threadid\/235914\/scope\/posts\/Default.aspx\"><span style=\"color: #669966\">little interest<\/span><\/a> in providing such assemblies to the public at large (arguing that users can build these themselves).\u00a0 I respectfully disagree, and would suggest that most capable of producing such assemblies would not need the additional forum assistance that such the debug builds would allow.<\/p>\n<p>Fortunately, the <a href=\"http:\/\/www.dotnetnuke.com\/About\/LicensingandTrademarks\/tabid\/776\/Default.aspx\"><span style=\"color: #669966\">DotNetNuke license<\/span><\/a> allows me to both recompile core assemblies with debug symbols, and to publish these builds to the general public.\u00a0 I intend to do so, and thereby (hopefully) aid others in solving some of the more difficult problems encountered in the wild.<\/p>\n<p>To this end, my next entry will contain major DotNetNuke assemblies with debugging symbols.\u00a0 I decided to split off the deployment instructions and downloads into a separate post so that downloading users can skip the preamble and get straight to the instructions and downloads.<\/p>\n<p>For those who have feedback regarding the philosophy and feasibility of this approach, I&#8217;d appreciate both.<\/p>\n<p>B<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During my time working with DotNetNuke, I have encountered innumerable forum posts in the following general form: I&#8217;m getting a very vague general exception error, and I&#8217;m not sure what is causing it.\u00a0 There doesn&#8217;t seem to be anything visible in the application\u00a0. . . [and] no errors as I&#8217;m navigating the site. Any and [&hellip;]<\/p>\n","protected":false},"author":1933,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3062,142],"tags":[3071,3070],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-dotnetnuke-dnn-content-management-system","category-technology","tag-debugging","tag-dotnetnuke"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/users\/1933"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":0,"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/brandonhaynes\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}