locked
Build error when using Web Deployment Projects - works fine when using Publish Web Site RRS feed

  • Question

  • User187399784 posted

    Hi,

     I am getting the following error when trying to build a web site in VS2005 using Web Deployment Projects...

    Target "AspNetCompiler" in file "C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets":

    Task "AspNetCompiler"

     

    Command:

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /_WebSite -p D:\IntDev\DotNet\AGS_Deployment\AGS\UI\WebPortal\_WebSite -u -f -fixednames D:\IntDev\DotNet\AGS_Deployment\_WebSite_deploy\Release\

    The "AspNetCompiler" task is using "aspnet_compiler.exe" from "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe".

    Utility to precompile an ASP.NET application

    Copyright (C) Microsoft Corporation. All rights reserved.

     

    D:\IntDev\DotNet\AGS_Deployment\AGS\UI\WebPortal\_WebSite\common\controls\com_tabstripfooter.ascx.vb(26): error BC30002: Type 'TabStripHeader.aecTabStyle' is not defined.

    D:\IntDev\DotNet\AGS_Deployment\AGS\UI\WebPortal\_WebSite\common\controls\com_tabstripfooter.ascx.vb(29): error BC30451: Name 'TabStripHeader' is not declared.

    D:\IntDev\DotNet\AGS_Deployment\AGS\UI\WebPortal\_WebSite\common\controls\com_tabstripfooter.ascx.vb(31): error BC30002: Type 'TabStripHeader.aecTabStyle' is not defined.

    D:\IntDev\DotNet\AGS_Deployment\AGS\UI\WebPortal\_WebSite\common\controls\com_tabstripfooter.ascx.vb(33): error BC30002: Type 'TabStripHeader.aecTabStyle' is not defined.

    The offending code in com_tabstripfooter.ascx.vb is ...

        Public Property aecStyle() As TabStripHeader.aecTabStyle
            Get
                If
    ViewState(M_STR_Style) Is Nothing Then
                    ViewState(M_STR_Style) = TabStripHeader.aecTabStyle.Standard
                End If
                Return CType
    (ViewState(M_STR_Style), TabStripHeader.aecTabStyle)
            End Get
            Set
    (ByVal value As TabStripHeader.aecTabStyle)
                ViewState(M_STR_Style) = value
            End Set
        End Property

    TabStripHeader.aecTabStyle is defined in another ascx control in the site,  com_tabstripheader.ascx...

        Public Enum aecTabStyle
            Standard
            Inner
        End Enum
    
     

    The com_tabstripfooter.ascx file contains a reference to the com_tabstripheader.ascx...

    <%@ Reference Control="~/common/controls/com_tabstripheader.ascx" %>

    The code behind of com_tabstripfooter.ascx imports the namespace that the com_tabstripheader.ascx control sits in, i.e. the com_tabstripheader.ascx is defined as...

    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="com_tabstripheader.ascx.vb" Inherits="common_controls_com_tabstripheader"  ClassName="AtlanticGlobal.AGS.UI.WebPortal.Common.Controls.TabStripHeader" %>

    ... and the com_tabstripfooter.ascx.vb contains the following...

    Imports AtlanticGlobal.AGS.UI.WebPortal.Common.Controls

     When I build the site, or publish the site using the standard VS 2005 Build or Publish process it works fine with no errors. However if I use a Web Deployent Project I  get the build errors described above. This happens whatever the Output Assemblies setting in the Web Deployment Project, and also happens both from the within the IDE and using MSBuild on the command line.

     I am stuck! Any ideas much appreciated.

    Thanks,

    James Storer

    Senior Developer

    Atlantic Global plc

     

     

     

    Wednesday, January 17, 2007 5:10 AM

All replies

  • User1487944164 posted

    the thing you have to remember, is that by merging all these assemblies, you are putting all your classes into the same namespace - you have a collision.

    putting your enum into a more specific namespace will give you a quick fix.

    Thursday, January 18, 2007 4:56 PM