Archive for June, 2009


Global.asax – using directive, Debugging

A quick ASP.Net tip

1) If you want to use any custom namespace or class in your global.asax you can use following syntax to use corresponding namespace.

<%@ Import Namespace="TristonFramework.Web" %>

or

<%@ Import Namespace="System.Web" %>

 

2) When you put a breakpoint in Global.asax and if it not firing than consider following tips

   a. Make sure you are using Debug environment ie <compilation debug="true">

    Warning : make sure you have switched compilation element to false before using the web.config in production. Otherwise it has a huge performance panelty. You can read about it here.

 
b. Try to edit the Global.asax by just hitting few enters in blank space. Sometimes when Global.asax is not changed after last build, asp.net does not consider it for debugging. i dont know why ? But this trick works almost always.

 

Thanks and Regards,

Mahin Gupta