<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx</link><description>If you have done some dev stuff with MOSS you have most likely seen this: " An unexpected error has occurred. " is something that you probably don't want to see at your browser.... you want to have customized error page. In ASP.NET application you normally</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Links (2/5/2008) &amp;laquo; Steve Pietrek&amp;#8217;s SharePoint Stuff</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#7480803</link><pubDate>Wed, 06 Feb 2008 05:04:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7480803</guid><dc:creator>Links (2/5/2008) « Steve Pietrek’s SharePoint Stuff</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://stevepietrekweblog.wordpress.com/2008/02/05/links-252008/"&gt;http://stevepietrekweblog.wordpress.com/2008/02/05/links-252008/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>WSS 3.0 &amp; MOSS: Recopilación de enlaces interesantes XV</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#7897407</link><pubDate>Tue, 26 Feb 2008 03:00:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7897407</guid><dc:creator>Blog del CIIN</dc:creator><description>&lt;p&gt;Hac&amp;#237;a tiempo que no revisaba mis RSS sobre SharePoint , y claro me ha costado ponerme al d&amp;#237;a, y aqu&amp;#237;&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8345194</link><pubDate>Mon, 31 Mar 2008 10:06:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345194</guid><dc:creator>gangadhar</dc:creator><description>&lt;p&gt;I am getting error saying that The given assembly name or codebase was invalid.&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8465596</link><pubDate>Wed, 07 May 2008 12:31:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8465596</guid><dc:creator>Ram</dc:creator><description>&lt;p&gt;Janne,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;We tried the same appraoch by creating a HTTPmodule hooking to Error event &amp;nbsp;and registered the same as a first module in MOSS web.config.But it did not work for us !&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Do you have any idea that what may be the cause of the issue ?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ram&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8465605</link><pubDate>Wed, 07 May 2008 12:37:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8465605</guid><dc:creator>jannemattila</dc:creator><description>&lt;p&gt;Hi Ram!&lt;/p&gt;
&lt;p&gt;Are you able to debug your code? I mean that if you attach your VS to the w3wp.exe process you're able to step through the lines of you handler?&lt;/p&gt;
&lt;p&gt;J&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8472045</link><pubDate>Thu, 08 May 2008 17:06:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8472045</guid><dc:creator>Asad kamran</dc:creator><description>&lt;p&gt;Janee,&lt;/p&gt;
&lt;p&gt;But when i deployed the http module i get this error:&lt;/p&gt;
&lt;p&gt;The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047&lt;/p&gt;
&lt;p&gt;Line 146: &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;add name=&amp;quot;MyExceptionHandler&amp;quot; type=&amp;quot;MyExceptionHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=229eff298acf7a7d&amp;quot; /&amp;gt;&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8512890</link><pubDate>Fri, 16 May 2008 15:50:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8512890</guid><dc:creator>ed</dc:creator><description>&lt;p&gt;Thank f for that. &amp;nbsp;1st person suggesting a solution. &amp;nbsp;My inferior but workable solution was to remove the error.aspx page from the layouts folder - the application_error event then fires in global.asax and I was able to handle it there.&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8518776</link><pubDate>Mon, 19 May 2008 10:10:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8518776</guid><dc:creator>ed</dc:creator><description>&lt;p&gt;Just wondering, can something similar be done for unauthorised access errors?&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8579478</link><pubDate>Sat, 07 Jun 2008 07:24:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8579478</guid><dc:creator>Brent</dc:creator><description>&lt;p&gt;Will your saolution work when the message is &lt;/p&gt;
&lt;p&gt;File not found?&lt;/p&gt;
</description></item><item><title>Catching unhandled exceptions in SharePoint--Janne Mattila</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#8963637</link><pubDate>Wed, 24 Sep 2008 17:14:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963637</guid><dc:creator>天使の泪</dc:creator><description>&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.as"&gt;http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.as&lt;/a&gt;...&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9011141</link><pubDate>Wed, 22 Oct 2008 17:35:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9011141</guid><dc:creator>Naman</dc:creator><description>&lt;p&gt;I created the httpmodule and added the tag in Web.config. &lt;/p&gt;
&lt;p&gt;&amp;lt;httpModules&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;clear /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;add name=&amp;quot;SABICCustomError&amp;quot; type=&amp;quot;SABICCustomError,SABICCustomError, Version=1.0.0.0, Culture=neutral, PublicKeyToken= 80a3837ac70f49e8&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;Attaching debugger and putting a breakpoint doesnt works.&lt;/p&gt;
&lt;p&gt;Looking forward for any help.&lt;/p&gt;
&lt;p&gt;namanc@gmail.com&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9011754</link><pubDate>Thu, 23 Oct 2008 00:34:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9011754</guid><dc:creator>m3rd</dc:creator><description>&lt;p&gt;what can you do if you limit a survey to only one response and the user gets an error page instead of a friendly &amp;quot;sorry, you cannot take the survey more than once.&amp;quot; and then return them to the home page.&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9034280</link><pubDate>Mon, 03 Nov 2008 21:18:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9034280</guid><dc:creator>Andy Burns</dc:creator><description>&lt;p&gt;Neat! I like that.&lt;/p&gt;
&lt;p&gt;One question though - what if I just want to use the HTTPModule to change the master page my error master page uses, rather than the simple.master it normally uses? I don't seem to be able to do that.&lt;/p&gt;
&lt;p&gt;Or, come to that, of redirecting the error pages for a single site/url? &amp;nbsp;Hmm. Tricky.&lt;/p&gt;
&lt;p&gt;m3rd, I suppose you could use what Janne has built above, but look at the error and if it is the survey exception, cancel the error and redirect to your own page with that message.&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9056947</link><pubDate>Mon, 10 Nov 2008 09:49:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9056947</guid><dc:creator>Ricardo Casquete</dc:creator><description>&lt;p&gt;Nice and Elegant....&lt;/p&gt;
&lt;p&gt;I was using before this approach which i think is worse than the one proposed by Janne&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AppDomain.CurrentDomain.UnhandledException &amp;nbsp;+= new UnhandledExceptionEventHandler ( OnUnhandledException );&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private void OnUnhandledException ( object sender, UnhandledExceptionEventArgs e )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Logger.Log ( e.ExceptionObject.ToString ( ), CATEGORY_UNHANDLED_EXCEPTIONS );&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9112544</link><pubDate>Mon, 17 Nov 2008 23:23:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9112544</guid><dc:creator>drew</dc:creator><description>&lt;p&gt;I'm having trouble &amp;nbsp;implementing this. &amp;nbsp;I'm using it in conjunction with stsdev. The error never gets attached. Am I missing something? Any ideas/tips to get started?&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9131575</link><pubDate>Fri, 21 Nov 2008 11:34:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131575</guid><dc:creator>Steve B</dc:creator><description>&lt;p&gt;This was a nice insight into Error Handling in SharePoint and very useful. &amp;nbsp;I've implemented more-or-less your design with a few additional logical paths to decide how to handle errors based on the web.config file settings. &amp;nbsp;We also had a requirement to log any exceptions so we opted for the EventLog (which needed to be called by an elevated method call using SPSecurity) which again works perfectly.&lt;/p&gt;
&lt;p&gt;We've had a couple of Publishing-based projects recently that have certainly benefited from this so many thanks again. ;)&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9399110</link><pubDate>Thu, 05 Feb 2009 20:02:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9399110</guid><dc:creator>Farrukh </dc:creator><description>&lt;p&gt;Hi, I have check this approach and it works fine for me. My custom page uses simple.master (just like error.aspx). I just need to ask if there would be any way to replace simple.master with my custom.master page.&lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9428459</link><pubDate>Tue, 17 Feb 2009 23:25:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9428459</guid><dc:creator>Faarukh</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I am able to create my on Custom Error Page with this approach, but some time it is throwing error in HTTPModule on Server.Transfer Statement. The error description is &amp;quot;&amp;quot;Error executing child request for ___.aspx&amp;quot;. Can any body tell me regarding that. What workaround do i have to do for that. Note down that I implement this for my Custom Sharepoint (MOSS) Site. &lt;/p&gt;
</description></item><item><title>re: Catching unhandled exceptions in SharePoint</title><link>http://blogs.msdn.com/jannemattila/archive/2008/02/04/catching-unhandled-exceptions-in-sharepoint.aspx#9940462</link><pubDate>Wed, 23 Dec 2009 10:48:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9940462</guid><dc:creator>srinivas</dc:creator><description>&lt;p&gt;To fix Given assembly or code base name is invalid error,&lt;/p&gt;
&lt;p&gt;Go to SharePoint site Web.Config file&lt;/p&gt;
&lt;p&gt;Add the newly created modules like below&lt;/p&gt;
&lt;p&gt;&amp;lt;add name=&amp;quot;Class Name&amp;quot; type=&amp;quot;NameSpace.ClassName,NameSpace, Version=1.0.0.0, Culture=neutral,PublicKeyToken=Token&amp;quot; /&amp;gt; &lt;/p&gt;
&lt;p&gt;please make sure that replace classname,namespace and token value according to your project&lt;/p&gt;
</description></item></channel></rss>