Hello,

While running in custom web hosting of NunitWeb I got a
NullReferenceException from TemplateParser.cs:118. The problem is that
HttpContext.Current is null. It's hard to reproduce in a small
standalone test, though. So I attach the stacktrace of my exception
together with the patch that fixes it. The fix changes the flow only
when HttpContext.Current is null, but probably it should set it always,
what do you guys think?

Also I found an interesting blog entry on the of HttpContext.Current
handling on dotnet:
http://piers7.blogspot.com/2005/11/threadstatic-callcontext-and_02.html

Any idea about how to create a testcase for the flow like in my
stacktrace will be appretiated.

If no one objects, I will commit.

Andrew.
System.NullReferenceException: Object reference not set to an instance of an 
object
in [0x00001] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/TemplateParser.cs:118)
 System.Web.UI.TemplateParser:AddApplicationAssembly ()
in [0x0003d] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/UserControlParser.cs:64)
 System.Web.UI.UserControlParser:.ctor (System.String virtualPath, 
System.String inputFile, System.Web.HttpContext context, System.String type)
in [0x00009] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs:47)
 System.Web.UI.MasterPageParser:.ctor (System.String virtualPath, System.String 
inputFile, System.Web.HttpContext context)
in [0x00003] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs:58)
 System.Web.UI.MasterPageParser:GetCompiledMasterType (System.String 
virtualPath, System.String inputFile, System.Web.HttpContext context)
in [0x00507] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/PageParser.cs:285) 
System.Web.UI.PageParser:ProcessMainAttributes (System.Collections.Hashtable 
atts)
in [0x00047] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/TemplateParser.cs:145)
 System.Web.UI.TemplateParser:AddDirective (System.String directive, 
System.Collections.Hashtable atts)
in [0x002fe] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs:175)
 System.Web.UI.TemplateControlParser:AddDirective (System.String directive, 
System.Collections.Hashtable atts)
in [0x000ad] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/PageParser.cs:317) 
System.Web.UI.PageParser:AddDirective (System.String directive, 
System.Collections.Hashtable atts)
in [0x00131] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs:353)
 System.Web.Compilation.AspGenerator:TagParsed (ILocation location, TagType 
tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes)
in (wrapper delegate-invoke) 
System.MulticastDelegate:invoke_void_ILocation_TagType_string_TagAttributes 
(System.Web.Compilation.ILocation,System.Web.Compilation.TagType,string,System.Web.Compilation.TagAttributes)
in [0x00015] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspParser.cs:467)
 System.Web.Compilation.AspParser:OnTagParsed (TagType tagtype, System.String 
id, System.Web.Compilation.TagAttributes attributes)
in [0x00100] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspParser.cs:163)
 System.Web.Compilation.AspParser:Parse ()
in [0x00012] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs:248)
 System.Web.Compilation.AspGenerator:Parse (System.String file)
in [0x00011] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs:265)
 System.Web.Compilation.AspGenerator:Parse ()
in [0x0004a] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs:278)
 System.Web.Compilation.AspGenerator:GetCompiledType ()
in [0x00008] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/PageParser.cs:334) 
System.Web.UI.PageParser:CompileIntoType ()
in [0x00001] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs:73)
 System.Web.UI.TemplateControlParser:GetCompiledInstance ()
in [0x0000a] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/PageParser.cs:101) 
System.Web.UI.PageParser:GetCompiledPageInstance (System.String virtualPath, 
System.String inputFile, System.Web.HttpContext context)
in [0x00004] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web.UI/PageHandlerFactory.cs:41)
 System.Web.UI.PageHandlerFactory:GetHandler (System.Web.HttpContext context, 
System.String requestType, System.String url, System.String path)
in [0x00068] (at 
/home/andrews/monobuild/mcs/class/System.Web/System.Web/HttpApplication.cs:1069)
 System.Web.HttpApplication:GetHandler (System.Web.HttpContext context)
in <0x00b3b> System.Web.HttpApplication+<Pipeline>__2:MoveNext ()

Attachment: HttpApplication.patch
Description: HttpApplication.patch

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to