Showing posts with label element. Show all posts
Showing posts with label element. Show all posts

Saturday, March 24, 2012

The element html occurs too few times.

I am using Beta 2 and have a problem with aspx files in that it is refusing to compile unless I have a top level HTML element. The problem with this is that I do not want to define the top level html in the aspx page, I want to define it in a usercontrol and then load that dynamically at runtime just as I can in ASP.NET 1.1. Surely there are other reasons you would want to have an aspx page without an <html> tag in it, I can think of several, why is there this limitation as it severly limits flexibility.
It says "The element 'html' occurs too few times."
Is there anyway to turn off this error to get it to compile?
Richard
"Surely there are other reasons you would want to have an aspx page without an <html> tag in it"
Like when? an aspx page is goign to spit out an HTML document, so the <html> tag makes perfect sense
Sounds like you have your programming all backwards, the aspx page should have the shell and the user controls should have the dynamic content, not the other way around
Like for example when you are trying to output WAP content for one, or plain text for another.
This is because I need to be able to easily substitute the head sections primarily dynamically, this enables multiple sites to run on the same codebase looking for Host headers to load the appropriate templates, it also allows easy support for text only versions of sites, just by dynamically loading text only versions of the user controls, this is for a database driven website content managed system.
Ive looked into master pages but they dont seem to really allow enough flexibility to do what I need to do as they require the definition of the whole document in them, but maybe ill have to work out some way to fudge it with those.
Im not sure what you are refering to about doing it backwards, the aspx page is the shell that loads up the user controls, and the user controls are what contain the dynamic content.
Hello.
Are you also removing the <head> section from the page? I've noticed in the past that if you remove the <html> tag but leave the <head runat="server"> you'll get that errror when you build the project in VS.
one more thing: you can use "filters" to apply different master pages to different browsers. for instance:

<%@.PageLanguage="C#"ie:MasterPageFile="~/Cap14/IE.master"MasterPageFile="~/Cap14/Mozilla.master"%>
applies a master page to IE and another to the other browsers. Check your browsers files to see the IDs of the browsers... oh, and you can alsouse adapters to render your pages/controls according to your needs in different browsers...


I don't think missing <html> element is an error. It is HTML markup validation message and is supposed to be a warning. Does it really break compilation or the page still runs? You can deal with the message in a few ways. First, you can disable validation in Tools | Options | Text Editor | HTML | Validation. Second, you can edit validation schema in Program Files\...\Common7\Packages\schemas\html (IE6_0.xsd, for example) and delete minOccurs="1" maxOccurs="1" from the <xsd:element name="html" >. Third, instead of using ASPX page, you can define your own file type, add it to the web.config and implement a handler for the type that will generate the response programmatically.

Giving it a fuller test it doesnt seem to break compilation on its own, I was getting other compilation errors too which were actually stopping it, but it does get reported as an error rather than a warning along with the other errors leading you to believe it is stopping compilation and needs to be fixed before you can compile.


I say just ignore it. If you are making an XML page, you can't have the <html> tag, for instance. So, just ignore it. That's what I do.

The element 'compilation' has invalid child element 'compilers'.

I have a number of web projects converted from 1.1 to 2.0 in VS2005.
I am methodically seeing the error below:
The element 'compilation' has invalid child element 'compilers'. List of
possible elements expected: 'assemblies, buildProviders, codeSubDirectories,
expressionBuilders'.
Here's what the web config looks like. The error doesn't cause any issues
and according to the MSDN documentation this is valid. So why is VS2005
giving me this bogus error?
<configuration>
<system.web>
<httpRuntime maxRequestLength="8192"/>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols (.pdb
information)
into the compiled page. Because this creates a larger file that
executes
more slowly, you should set this value to true only when debugging
and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="vb" debug="true" batch="false">
<compilers>
<compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
/imports:Microsoft.VisualBasic,System,System.Collections,System.Configuratio
n,System.Data,System.Drawing,System.Web,System.Web.UI,System.Web.UI.HtmlCont
rols,System.Web.UI.WebControls"/></compilers>
<assemblies>
etc, etc,In 2.0, the <compilers> section is found in machine.config,
so you don't need to place it in web.config.
Check out machine.config.comments in the .Net Framework\config dir.
The syntax has changed.
It's now in the <system.codedom> section.
See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Robert" <robertv@.noemail.nospam> wrote in message
news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com...
>I have a number of web projects converted from 1.1 to 2.0 in VS2005.
> I am methodically seeing the error below:
> The element 'compilation' has invalid child element 'compilers'. List of
> possible elements expected: 'assemblies, buildProviders, codeSubDirectorie
s,
> expressionBuilders'.
> Here's what the web config looks like. The error doesn't cause any issues
> and according to the MSDN documentation this is valid. So why is VS2005
> giving me this bogus error?
> <configuration>
> <system.web>
> <httpRuntime maxRequestLength="8192"/>
> <!-- DYNAMIC DEBUG COMPILATION
> Set compilation debug="true" to insert debugging symbols (.pdb
> information)
> into the compiled page. Because this creates a larger file that
> executes
> more slowly, you should set this value to true only when debuggin
g
> and to
> false at all other times. For more information, refer to the
> documentation about
> debugging ASP.NET files.
> -->
> <compilation defaultLanguage="vb" debug="true" batch="false">
> <compilers>
> <compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
> System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
> extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
> /imports:Microsoft.VisualBasic,System,System.Collections,System.Configurat
ion,System.Data,System.Drawing,System.Web,System.Web.UI,System.Web.UI.HtmlCo
ntrols,System.Web.UI.WebControls"/></compilers>
> <assemblies>
> etc, etc,
>

The element compilation has invalid child element compilers.

I have a number of web projects converted from 1.1 to 2.0 in VS2005.

I am methodically seeing the error below:

The element 'compilation' has invalid child element 'compilers'. List of
possible elements expected: 'assemblies, buildProviders, codeSubDirectories,
expressionBuilders'.

Here's what the web config looks like. The error doesn't cause any issues
and according to the MSDN documentation this is valid. So why is VS2005
giving me this bogus error?

<configuration>
<system.web>
<httpRuntime maxRequestLength="8192"/>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols (.pdb
information)
into the compiled page. Because this creates a larger file that
executes
more slowly, you should set this value to true only when debugging
and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="vb" debug="true" batch="false">
<compilers>
<compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Configuration,System.Data,System.Draw ing,System.Web,System.Web.UI,System.Web.UI.HtmlCon trols,System.Web.UI.WebControls"/></compilers>
<assemblies
etc, etc,In 2.0, the <compilers> section is found in machine.config,
so you don't need to place it in web.config.

Check out machine.config.comments in the .Net Framework\config dir.

The syntax has changed.
It's now in the <system.codedom> section.

See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
"Robert" <robertv@.noemail.nospam> wrote in message
news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com...
>I have a number of web projects converted from 1.1 to 2.0 in VS2005.
> I am methodically seeing the error below:
> The element 'compilation' has invalid child element 'compilers'. List of
> possible elements expected: 'assemblies, buildProviders, codeSubDirectories,
> expressionBuilders'.
> Here's what the web config looks like. The error doesn't cause any issues
> and according to the MSDN documentation this is valid. So why is VS2005
> giving me this bogus error?
> <configuration>
> <system.web>
> <httpRuntime maxRequestLength="8192"/>
> <!-- DYNAMIC DEBUG COMPILATION
> Set compilation debug="true" to insert debugging symbols (.pdb
> information)
> into the compiled page. Because this creates a larger file that
> executes
> more slowly, you should set this value to true only when debugging
> and to
> false at all other times. For more information, refer to the
> documentation about
> debugging ASP.NET files.
> -->
> <compilation defaultLanguage="vb" debug="true" batch="false">
> <compilers>
> <compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
> System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
> extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
> /imports:Microsoft.VisualBasic,System,System.Collec tions,System.Configuration,System.Data,System.Draw ing,System.Web,System.Web.UI,System.Web.UI.HtmlCon trols,System.Web.UI.WebControls"/></compilers>
> <assemblies>
> etc, etc,
Thanks for the response.

I removed it entirely from web.config as it is apparently unnecessary.

Guess I wish the migration wizard could of either 1) removed it for me or 2)
flagged it as a todo with an explanation.

Thx.
R-

"Juan T. Llibre" wrote:

> In 2.0, the <compilers> section is found in machine.config,
> so you don't need to place it in web.config.
> Check out machine.config.comments in the .Net Framework\config dir.
> The syntax has changed.
> It's now in the <system.codedom> section.
> See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
> ======================================
> "Robert" <robertv@.noemail.nospam> wrote in message
> news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com...
> >I have a number of web projects converted from 1.1 to 2.0 in VS2005.
> > I am methodically seeing the error below:
> > The element 'compilation' has invalid child element 'compilers'. List of
> > possible elements expected: 'assemblies, buildProviders, codeSubDirectories,
> > expressionBuilders'.
> > Here's what the web config looks like. The error doesn't cause any issues
> > and according to the MSDN documentation this is valid. So why is VS2005
> > giving me this bogus error?
> > <configuration>
> > <system.web>
> > <httpRuntime maxRequestLength="8192"/>
> > <!-- DYNAMIC DEBUG COMPILATION
> > Set compilation debug="true" to insert debugging symbols (.pdb
> > information)
> > into the compiled page. Because this creates a larger file that
> > executes
> > more slowly, you should set this value to true only when debugging
> > and to
> > false at all other times. For more information, refer to the
> > documentation about
> > debugging ASP.NET files.
> > -->
> > <compilation defaultLanguage="vb" debug="true" batch="false">
> > <compilers>
> > <compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
> > System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
> > extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
> > /imports:Microsoft.VisualBasic,System,System.Collec tions,System.Configuration,System.Data,System.Draw ing,System.Web,System.Web.UI,System.Web.UI.HtmlCon trols,System.Web.UI.WebControls"/></compilers>
> > <assemblies>
> > etc, etc,
>
Hi Robert,

Yes, what a pity that the migration wizard was not able to automatically
correct this, maybe it is due to the <system.codedom> is outside the
<system.web> that beyond the migration checking. Anyway, the error message
make some sense, also thanks for Juan's informative suggestion.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

-------
| Thread-Topic: The element 'compilation' has invalid child element
'compilers
| thread-index: AcXpe7dhGIAffoz4SzOtjdSjQDOyUA==
| X-WBNR-Posting-Host: 67.180.214.235
| From: =?Utf-8?B?Um9iZXJ0?= <robertv@.noemail.nospam>
| References: <9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com>
<ewe5xmX6FHA.3924@.TK2MSFTNGP10.phx.gbl>
| Subject: Re: The element 'compilation' has invalid child element
'compilers
| Date: Mon, 14 Nov 2005 16:30:01 -0800
| Lines: 72
| Message-ID: <0A4CC52E-0180-414A-9D4D-DAF5F94820F1@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358118
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the response.
|
| I removed it entirely from web.config as it is apparently unnecessary.
|
| Guess I wish the migration wizard could of either 1) removed it for me or
2)
| flagged it as a todo with an explanation.
|
| Thx.
| R-
|
| "Juan T. Llibre" wrote:
|
| > In 2.0, the <compilers> section is found in machine.config,
| > so you don't need to place it in web.config.
| >
| > Check out machine.config.comments in the .Net Framework\config dir.
| >
| > The syntax has changed.
| > It's now in the <system.codedom> section.
| >
| > See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx
| >
| >
| >
| >
| > Juan T. Llibre, ASP.NET MVP
| > ASP.NET FAQ : http://asp.net.do/faq/
| > ASPNETFAQ.COM : http://www.aspnetfaq.com/
| > Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
| > ======================================
| > "Robert" <robertv@.noemail.nospam> wrote in message
| > news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com...
| > >I have a number of web projects converted from 1.1 to 2.0 in VS2005.
| | > > I am methodically seeing the error below:
| | > > The element 'compilation' has invalid child element 'compilers'.
List of
| > > possible elements expected: 'assemblies, buildProviders,
codeSubDirectories,
| > > expressionBuilders'.
| | > > Here's what the web config looks like. The error doesn't cause any
issues
| > > and according to the MSDN documentation this is valid. So why is
VS2005
| > > giving me this bogus error?
| | > > <configuration>
| > > <system.web>
| > > <httpRuntime maxRequestLength="8192"/>
| > > <!-- DYNAMIC DEBUG COMPILATION
| > > Set compilation debug="true" to insert debugging symbols
(.pdb
| > > information)
| > > into the compiled page. Because this creates a larger file
that
| > > executes
| > > more slowly, you should set this value to true only when
debugging
| > > and to
| > > false at all other times. For more information, refer to the
| > > documentation about
| > > debugging ASP.NET files.
| > > -->
| > > <compilation defaultLanguage="vb" debug="true" batch="false">
| > > <compilers>
| > > <compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
| > > System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"
| > > extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
| /imports:Microsoft.VisualBasic,System,System.Collec tions,System.Configuratio
n,System.Data,System.Drawing,System.Web,System.Web .UI,System.Web.UI.HtmlCont
rols,System.Web.UI.WebControls"/></compilers>
| > > <assemblies>
| | > > etc, etc,
| | | >
| >
| >
|

The element 'compilation' has invalid child element 'compilers

Thanks for the response.
I removed it entirely from web.config as it is apparently unnecessary.
Guess I wish the migration wizard could of either 1) removed it for me or 2)
flagged it as a todo with an explanation.
Thx.
R-
"Juan T. Llibre" wrote:

> In 2.0, the <compilers> section is found in machine.config,
> so you don't need to place it in web.config.
> Check out machine.config.comments in the .Net Framework\config dir.
> The syntax has changed.
> It's now in the <system.codedom> section.
> See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx
>
>
> Juan T. Llibre, ASP.NET MVP
> ASP.NET FAQ : http://asp.net.do/faq/
> ASPNETFAQ.COM : http://www.aspnetfaq.com/
> Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
> ======================================
> "Robert" <robertv@dotnet.itags.org.noemail.nospam> wrote in message
> news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@dotnet.itags.org.microsoft.com...
>
>Hi Robert,
Yes, what a pity that the migration wizard was not able to automatically
correct this, maybe it is due to the <system.codedom> is outside the
<system.web> that beyond the migration checking. Anyway, the error message
make some sense, also thanks for Juan's informative suggestion.
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| Thread-Topic: The element 'compilation' has invalid child element
'compilers
| thread-index: AcXpe7dhGIAffoz4SzOtjdSjQDOyUA==
| X-WBNR-Posting-Host: 67.180.214.235
| From: examnotes <robertv@.noemail.nospam>
| References: <9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com>
<ewe5xmX6FHA.3924@.TK2MSFTNGP10.phx.gbl>
| Subject: Re: The element 'compilation' has invalid child element
'compilers
| Date: Mon, 14 Nov 2005 16:30:01 -0800
| Lines: 72
| Message-ID: <0A4CC52E-0180-414A-9D4D-DAF5F94820F1@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:358118
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the response.
|
| I removed it entirely from web.config as it is apparently unnecessary.
|
| Guess I wish the migration wizard could of either 1) removed it for me or
2)
| flagged it as a todo with an explanation.
|
| Thx.
| R-
|
| "Juan T. Llibre" wrote:
|
| > In 2.0, the <compilers> section is found in machine.config,
| > so you don't need to place it in web.config.
| >
| > Check out machine.config.comments in the .Net Framework\config dir.
| >
| > The syntax has changed.
| > It's now in the <system.codedom> section.
| >
| > See : http://msdn2.microsoft.com/en-us/library/e4hwk57e.aspx
| >
| >
| >
| >
| > Juan T. Llibre, ASP.NET MVP
| > ASP.NET FAQ : http://asp.net.do/faq/
| > ASPNETFAQ.COM : http://www.aspnetfaq.com/
| > Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
| > ======================================
| > "Robert" <robertv@.noemail.nospam> wrote in message
| > news:9999C8CB-CF4F-4F1A-89A5-775753A7B124@.microsoft.com...
| > >I have a number of web projects converted from 1.1 to 2.0 in VS2005.
| > >
| > > I am methodically seeing the error below:
| > >
| > > The element 'compilation' has invalid child element 'compilers'.
List of
| > > possible elements expected: 'assemblies, buildProviders,
codeSubDirectories,
| > > expressionBuilders'.
| > >
| > > Here's what the web config looks like. The error doesn't cause any
issues
| > > and according to the MSDN documentation this is valid. So why is
VS2005
| > > giving me this bogus error?
| > >
| > > <configuration>
| > > <system.web>
| > > <httpRuntime maxRequestLength="8192"/>
| > > <!-- DYNAMIC DEBUG COMPILATION
| > > Set compilation debug="true" to insert debugging symbols
(.pdb
| > > information)
| > > into the compiled page. Because this creates a larger file
that
| > > executes
| > > more slowly, you should set this value to true only when
debugging
| > > and to
| > > false at all other times. For more information, refer to the
| > > documentation about
| > > debugging ASP.NET files.
| > > -->
| > > <compilation defaultLanguage="vb" debug="true" batch="false">
| > > <compilers>
| > > <compiler language="vb" type="Microsoft.VisualBasic.VBCodeProvider,
| > > System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"
| > > extension=".VB" compilerOptions="/define:Debug=True /define:Trace=True
| > >
/imports:Microsoft.VisualBasic,System,System.Collections,System.Configuratio
n,System.Data,System.Drawing,System.Web,System.Web.UI,System.Web.UI.HtmlCont
rols,System.Web.UI.WebControls"/></compilers>
| > > <assemblies>
| > >
| > > etc, etc,
| > >
| > >
| >
| >
| >
|