Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CS0246: The type or namespace name 'TemplateContainer' could not be found

1,326 views
Skip to first unread message

robse...@gmail.com

unread,
Feb 6, 2006, 4:36:49 AM2/6/06
to

Hi!
I have a Asp.net 2.0 application that uses a masterpage. It works fine
on the development machine but when I move the app to a Win 2003 server
thinks go wrong: When I navigate to a page that uses the masterpage I
get the CS0246 error:

Compiler Error Message: CS0246: The type or namespace name
'TemplateContainer' could not be found (are you missing a using
directive or an assembly reference?)

Source Error:

Line 117: }
Line 118:
Line 119: [TemplateContainer(typeof(System.Web.UI.MasterPage))]
Line 120:
[TemplateInstanceAttribute(System.Web.UI.TemplateInstance.Single)]
Line 121: public virtual System.Web.UI.ITemplate
Template_ContentPlaceHolder1 {


Pages that don't use the masterpage work OK,
any ideas?

many thanks in advance

Michael E Baltic

unread,
Mar 16, 2006, 1:56:11 PM3/16/06
to
Check the web.config file. In the <system.web><pages></pages></system.web>
section, I had the following:

<pages
buffer="true"
enableSessionState="true"
enableViewState="true"
enableViewStateMac="true"
smartNavigation="false"
autoEventWireup="true"
pageBaseType="System.Web.UI.Page"
userControlBaseType="System.Web.UI.UserControl"
validateRequest="true"
masterPageFile=""
theme="CardinalHealthTheme"
styleSheetTheme=""
maxPageStateFieldLength="-1"
compilationMode="Always"
pageParserFilterType=""
viewStateEncryptionMode="Auto"
maintainScrollPositionOnPostBack="false"
asyncTimeout="45">
<namespaces>
<clear />
</namespaces>
<tagMapping>
<clear />
</tagMapping>
</pages>

It caused the same error that you reported. If you notice, I cleared the
namespaces and tagmappings. If you remove the <clear /> from the namespaces
section, it will build again.

--
Senior .NET Consultant
Enterprise Web Services
Cardinal Solutions Group
www.cardinalsolutions.com

0 new messages