Oct 9th, 2009 | 1 Comment

The .Net Framework has a feature called Shadow Copy.

Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location.



But this may create problem sometimes.

Written by Ajay Matharu

October 9th, 2009 at 12:49 pm

Sep 7th, 2009 | No Comments

The following code snippet will help you to catch an error in the global.asax file,

Turn off the custom error mode in web.config file first,

<customErrors mode="Off">

And add this code in your global.asax file to catch the error,

void Application_Error(object sender, EventArgs e)
 {
 HttpContext context = ((HttpApplication)sender).Context;
 if (context.Error != null)
 {
 Exception ex = context.Error;
 string msg = string.Empty;

 while (ex != null)
 {
 if (!string.IsNullOrEmpty(ex.Message))
 msg += ex.ToString() + "<br /><br />";
 ex = ex.InnerException;
 }
 context.Response.Clear();
 context.Response.Write(msg);
 context.Response.End();
 }
 } 

Hope this helps :)

Written by Ajay Matharu

September 7th, 2009 at 9:53 am

Page 1 of 3123