Unable to generate code...

From: A Traveler (hitchhikersguideto-news_at_yahoo.com)
Date: 10/12/04


Date: Tue, 12 Oct 2004 16:22:52 -0400

Hello, i am having this problem. The exact error message is:

"Unable to generate code for a value of type 'System.Web.UI.Page'. This
error occurred while trying to generate the property value for Page."

After a lot of googling, all i can find that this applies to is when trying
to use enum-type datatypes as bit-vector flags, or when use designers to
make an expandable property in the property tool-window. However, NEITHer of
these cases apply to my page. This is only happening on one page in the
project. But the stack trace of the error (included at the end) gives me no
hint of where to even start looking to fix it, of WHAt exactly might be
wrong with the page.

Thanks in advance,
- Arthur Dent.

===================================================

<stackTrace>
[HttpException (0x80004005): Unable to generate code for a value of type
'System.Web.UI.Page'. This error occurred while trying to generate the
property value for Page.]
   System.Web.Compilation.CodeDomUtility.GenerateExpressionForValue(PropertyInfo
propertyInfo, Object value, Type valueType) +2369
   System.Web.Compilation.TemplateControlCompiler.BuildBuildMethod(ControlBuilder
builder, Boolean fTemplate, PropertySetterEntry pse) +2545
   System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder
builder, Boolean fInTemplate, PropertySetterEntry pse) +794
   System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder
builder, Boolean fInTemplate, PropertySetterEntry pse) +352
   System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder
builder, Boolean fInTemplate, PropertySetterEntry pse) +352
   System.Web.Compilation.TemplateControlCompiler.BuildSourceDataTreeFromBuilder(ControlBuilder
builder, Boolean fInTemplate, PropertySetterEntry pse) +352
   System.Web.Compilation.TemplateControlCompiler.BuildMiscClassMembers()
+51
   System.Web.Compilation.PageCompiler.BuildMiscClassMembers() +9
   System.Web.Compilation.BaseCompiler.BuildSourceDataTree() +1279
   System.Web.Compilation.BaseCompiler.GetCompiledType() +129
   System.Web.UI.PageParser.CompileIntoType() +59
   System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation() +126

[HttpException (0x80004005): Unable to generate code for a value of type
'System.Web.UI.Page'. This error occurred while trying to generate the
property value for Page.]
   System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
fCreateIfNotFound) +692
   System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath() +125
   System.Web.UI.TemplateParser.GetParserCacheItem() +88
   System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
virtualPath, String inputFile, HttpContext context) +116
   System.Web.UI.TemplateControlParser.GetCompiledInstance(String
virtualPath, String inputFile, HttpContext context) +36
   System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String
virtualPath, String inputFile, HttpContext context) +43
   System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String
requestType, String url, String path) +44
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, String path, String pathTranslated, Boolean useAppConfig) +699
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+95
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +173
</stackTrace>



Relevant Pages

  • Could not load type XXXXXXXXXXXXXX from assembly mscorlib
    ... Could you please take a look at an exception for ASP.NET application? ... r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +794 ... virtualPath, String inputFile, HttpContext context) +36 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Could not load type ********** from assembly mscorlib
    ... Could you please take a look at an exception for ASP.NET application? ... r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +794 ... virtualPath, String inputFile, HttpContext context) +36 ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Steven Cheng, could you please take a look at the exception?
    ... Could you please take a look at an exception for ASP.NET application? ... r(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry pse) +794 ... virtualPath, String inputFile, HttpContext context) +36 ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Unable to generate code...
    ... > builder, Boolean fInTemplate, PropertySetterEntry pse) +794 ... > virtualPath, String inputFile, HttpContext context) +36 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Debug Question
    ... ilder(ControlBuilder builder, Boolean fInTemplate, PropertySetterEntry ... virtualPath, String inputFile, HttpContext context) +36 ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)