【问题标题】:Compilation Error after deoplyment. Doesn't recognize 'Theme' attributedeoplyment 后编译错误。无法识别“主题”属性
【发布时间】:2009-07-07 16:42:16
【问题描述】:

我的本​​地副本工作正常,然后我发布网站并收到此错误。

编译错误

描述:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。

编译器错误消息:BC30456:“主题”不是“ASP.invoice_aspx”的成员。

来源错误:

第 1 行:

第 2 行:

第 3 行:<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">

源文件:C:\Inetpub\eSolutions_xyAMP_DEV\Invoice.aspx 行:1

这是怎么回事?

HTML 源代码

<%@ Page Title="Invoice" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Invoice.aspx.vb" Inherits="Invoice" Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%;">    
        <tr>
            <td align="center">
                <asp:panel id="pnl"   runat="server"
                Width="992px" Wrap="False" HorizontalAlign="Center"  >
                <asp:Button id="btnPrepareInvoice" runat="server"   Text="Trial Invoice"  ></asp:Button>
                <asp:Button id="btnFinalize" runat="server"   Text="Final Invoice"   ></asp:Button>
                </asp:panel>
             </td>
        </tr>
    </table>
    <br />
    <table width="100%"> 
        <tr>
        <td     class="Subhdr" align="center" >
            <asp:Label ID="Label7" Cssclass="ScreenHdr"  runat="server" Font-Bold="True"  
            Font-Size="Medium"   Height="24px" 
                  Width="221px">Issued Contracts</asp:Label>
             </td>
             </tr>
             </table>
             <asp:datagrid id="dgrContracts"  
                runat="server" HorizontalAlign="Center"  BorderColor="#C0C0FF" 
        ForeColor="Blue" Font-Size="8pt" Font-Bold="True" BorderWidth="1px" 
        BorderStyle="Solid" Font-Names="Arial"
                  ShowFooter="True" OnPageIndexChanged="IssueDataGrid_Page" 
        OnSortCommand="IssueDataGrid_Sort" AllowPaging="True" CellPadding="2" 
        GridLines="Horizontal" AutoGenerateColumns="False"
                AllowSorting="True" OnItemCommand="IssueDataGrid_Command" Width="100%">
                <FooterStyle Wrap="False" HorizontalAlign="Left" VerticalAlign="Top"></FooterStyle>
                <SelectedItemStyle Wrap="False" BackColor="#E0E0E0"></SelectedItemStyle>
                <EditItemStyle Wrap="False"></EditItemStyle>
                <AlternatingItemStyle Font-Size="8pt" Font-Bold="True" Wrap="False" HorizontalAlign="Left" Height="18px"
                    BorderWidth="1px" ForeColor="#0000C0" BorderStyle="Solid" BorderColor="#C0C0FF" VerticalAlign="Middle"
                    ></AlternatingItemStyle>
                <ItemStyle Font-Size="8pt" Font-Names="Arial" Font-Bold="True" Wrap="False" HorizontalAlign="Left"
                    Height="18px" ForeColor="#0000C0" VerticalAlign="Middle"></ItemStyle>
                <HeaderStyle Font-Size="8pt" Font-Names="Arial" Font-Bold="True" Wrap="False" HorizontalAlign="Left"
                    Height="18px" ForeColor="White" BackColor="Blue"></HeaderStyle>
                <Columns>
                    <asp:TemplateColumn>
                        <ItemTemplate>
                            <asp:Button id="btnSelect" runat="server" Width="13px" BackColor="Yellow" ForeColor="White"
                                Height="13px" CommandName="Select"></asp:Button>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="MBI_Selected"></asp:BoundColumn>
                    <asp:BoundColumn DataField="CUST_CombinedNumber" SortExpression="CUST_CombinedNumber" HeaderText="Number">
                        <HeaderStyle Width="60px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CUST_Name" SortExpression="CUST_Name" HeaderText="Name" HeaderStyle-Width="110px" />
                    <asp:BoundColumn DataField="DisplayDate" SortExpression="MBI_Date" HeaderText="Effective">
                        <HeaderStyle Width="80px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="VEHL_Year" HeaderText="Year">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="DisplayMake" HeaderText="Make">
                        <HeaderStyle Width="100px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="VEHL_Model" HeaderText="Model">
                        <HeaderStyle Width="120px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="MBI_PlanCode" HeaderText="Plan">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="DisplayExchangePrice" HeaderText="Exch">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="MBI_DlrCost" HeaderText="Cost" DataFormatString="{0:C}">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                </Columns>
                <PagerStyle VerticalAlign="Top" NextPageText="&gt;&gt;&gt;&gt;" Height="18px" PrevPageText="&lt;&lt;&lt;&lt;"
                    HorizontalAlign="Left" ForeColor="White" BackColor="Blue" Wrap="False"></PagerStyle>
            </asp:datagrid>

              <table width="100%"> 
        <tr>
        <td     class="Subhdr" align="center" >
            <asp:Label ID="Label1" Cssclass="ScreenHdr"  runat="server" Font-Bold="True"  
            Font-Size="Medium"   Height="24px" 
                  Width="221px">Cancelled Contracts</asp:Label>
             </td>
             </tr>
             </table>

             <asp:datagrid id="dgrCancels"  
                runat="server" HorizontalAlign="Center"   BorderColor="#C0C0FF" 
        ForeColor="Blue" Font-Size="8pt" Font-Bold="True" BorderWidth="1px" 
        BorderStyle="Solid" Font-Names="Arial"  PageSize="5" ShowFooter="True" OnPageIndexChanged="CancelDataGrid_Page"
                OnSortCommand="CancelDataGrid_Sort" AllowPaging="True" CellPadding="2" 
        GridLines="Horizontal" AutoGenerateColumns="False" AllowSorting="True" 
        OnItemCommand="CancelDataGrid_Command" Width="100%">
                <FooterStyle Wrap="False" HorizontalAlign="Left" VerticalAlign="Top"></FooterStyle>
                <SelectedItemStyle Wrap="False" BackColor="#E0E0E0"></SelectedItemStyle>
                <EditItemStyle Wrap="False"></EditItemStyle>
                <AlternatingItemStyle Font-Size="8pt" Font-Bold="True" Wrap="False" HorizontalAlign="Left" Height="18px"
                    BorderWidth="1px" ForeColor="#0000C0" BorderStyle="Solid" BorderColor="#C0C0FF" VerticalAlign="Middle"
                    ></AlternatingItemStyle>
                <ItemStyle Font-Size="8pt" Font-Names="Arial" Font-Bold="True" Wrap="False" HorizontalAlign="Left"
                    Height="18px" ForeColor="#0000C0" VerticalAlign="Middle"></ItemStyle>
                <HeaderStyle Font-Size="8pt" Font-Names="Arial" Font-Bold="True" Wrap="False" HorizontalAlign="Left"
                    Height="18px" ForeColor="White" BackColor="Blue"></HeaderStyle>
                <Columns>
                    <asp:TemplateColumn>
                        <ItemTemplate>
                            <asp:Button id="btnCancelSelect" runat="server" Width="13px" BackColor="Yellow" ForeColor="White"
                                Height="13px" CommandName="Select"></asp:Button>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="CNCL_ID">
                        <HeaderStyle Width="0px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CNCL_Selected"></asp:BoundColumn>
                    <asp:BoundColumn DataField="CUST_CombinedNumber" SortExpression="CUST_CombinedNumber" HeaderText="Number">
                        <HeaderStyle Width="60px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CUST_Name" SortExpression="CUST_Name" HeaderText="Name">
                        <HeaderStyle Width="200px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="DisplayIssueDate" SortExpression="MBI_Date" HeaderText="Effective">
                        <HeaderStyle Width="80px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="DisplayCancelDate" HeaderText="Cancel">
                        <HeaderStyle Width="80px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="MBI_Miles" HeaderText="Effective">
                        <HeaderStyle Width="60px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CNCL_CancelMiles" HeaderText="Cancel">
                        <HeaderStyle Width="60px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="MBI_Price" HeaderText="Price" DataFormatString="{0:C}">
                        <HeaderStyle Width="40px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CNCL_CalculatedNetRefund" HeaderText="Price Refund" DataFormatString="{0:C}">
                        <HeaderStyle Width="40px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="MBI_DlrCost" HeaderText="Cost" DataFormatString="{0:C}">
                        <HeaderStyle Width="40px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="CNCL_CalculatedNetAdminRefund" HeaderText="Cost Refund" DataFormatString="{0:C}">
                        <HeaderStyle Width="40px"></HeaderStyle>
                    </asp:BoundColumn>
                </Columns>
                <PagerStyle VerticalAlign="Top" NextPageText="&gt;&gt;&gt;&gt;" Height="18px" PrevPageText="&lt;&lt;&lt;&lt;"
                    HorizontalAlign="Left" ForeColor="White" BackColor="Blue" Wrap="False"></PagerStyle>
            </asp:datagrid>
              <asp:Label ID="Errormsg" runat="server" ForeColor="#CC0000"  ></asp:Label>
</asp:Content>

【问题讨论】:

    标签: asp.net compiler-construction themes


    【解决方案1】:

    我在这里发现了我的问题。我的 dbml 上有一个名为“Invoice”的类以及一个名为“Invoice.aspx”的页面。这是一个网站项目,而不是一个 WebApplication,因此 .net 说“编译器错误消息:BC30456:'Theme' 不是 'ASP.invoice_aspx' 的成员”是正确的。呸呸呸。我想知道为什么这不会出现在本地。该站点在我的本地机器上运行良好,这是在将站点发布到服务器后显示的。无论如何,这现在正在工作。我刚刚重命名了 aspx 页面并重新发布。

    谢谢, ~ck 在圣地亚哥

    【讨论】:

      【解决方案2】:

      进入部署项目的属性页。在“编译”选项卡下,取消选中“允许此预编译站点可更新”选项。这解决了我的问题。

      【讨论】:

        【解决方案3】:

        以前从未见过这个,但我会先仔细检查虚拟目录或网站上的版本设置,以确保它针对的是正确的运行时。

        【讨论】:

          【解决方案4】:

          试试这个:

          http://arjansworld.blogspot.com/2006/11/aspnet-20-tip-theme-is-not-member-of.html

          你能把HTML代码放在这里让我们看看吗?您确定已从部署到的目录中清除了所有旧 DLL 吗?

          【讨论】:

          • 添加了源,是的,我在发布之前清除了服务器上的 BIN
          • 您的 web.config 中是否有任何引用主题的内容?您是否将其设置为使用固定命名?
          • 我发现了问题。谢谢你的帮助。这是一个重复的类名。我的 LinqToSQL dbml 文件中已经存在“发票”。我重命名了文件,一切正常。毕竟它与“主题”无关。
          【解决方案5】:

          我有同样的问题。这与主题无关。检查 bin 文件夹中的重复 DLLS。您可以删除

          ',App_Web_1d5eb-af'

          继承声明的一部分。但问题是 bin 文件夹中的重复库,一旦您识别并删除/移动它们,错误就会消失。如果不将它们全部删除并重建,则可能是一些剩余的旧版 dll。

          【讨论】:

            【解决方案6】:

            我遇到了类似的问题。我找到了解决方案here

            当项目中有 2 个同名的部分类时,就会出现问题。就我而言,我已将 Home.aspx.vb 重命名为 Home-OLD.aspx.vb 并将其替换为另一个名为 Home.aspx 的页面(和代码隐藏文件)。问题是我没有重命名 Home-OLD.aspx.vb 中的类,所以我在项目中有 2 个名为 Home 的类。

            我最终暂时注释掉了旧的 Home-OLD.aspxHome-OLD.aspx.vb 代码并且它起作用了。

            【讨论】:

              【解决方案7】:

              如果您已确认没有类名冲突并且您使用的是动态编译网站,则可能需要清除 Temp ASP 文件。查看 .dll 错误的完整路径并删除它所在的文件夹。

              C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ [您的站点] \ [随机数] \ [您的站点 dll]

              C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\ [您的站点] \ [随机数] \ [您的站点 dll]

              【讨论】:

                猜你喜欢
                • 2014-01-13
                • 2017-02-10
                • 2014-08-08
                • 2020-10-07
                • 2020-02-07
                • 1970-01-01
                • 1970-01-01
                • 2015-01-11
                • 1970-01-01
                相关资源
                最近更新 更多