开发者

The configuration section 'assemblies' cannot be read because it is missing a section declaration

开发者 https://www.devze.com 2023-04-11 20:49 出处:网络
I use asp.net 4, I have some strange problem with my web.config, I receive this error. It seems that inside the <compilation> section there is some not well formatted code.

I use asp.net 4, I have some strange problem with my web.config, I receive this error. It seems that inside the <compilation> section there is some not well formatted code.

Any idea what could be? I tried different way but still does not work. Please provide me a sample of code. thanks

The requested page cannot be accessed because the related configuration data for the page is invalid. The configuration section 'assemblies' cannot be read because it is missing a section declaration

<compilation debug="true" targetFramework="4.0" />
    <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="WebProject.Core"/>
        <add assembly="WebProject.DataAccess"/>
        <add assembly="WebProject.Cms"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, Pu开发者_Go百科blicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
    </compilation>


Don't self-close your <compilation> tag:

<compilation debug="true" targetFramework="4.0" />

It should be:

<compilation debug="true" targetFramework="4.0">

as it is closed at the end, after the assemblies tag.


To learn more about the encountered issue, open the “Web.config” file and analyze the VS “Error List” window (View -> Error List).

See the http://msdn.microsoft.com/en-us/library/ms178685.aspx MSDN article to learn more about Web.config file structure.

0

精彩评论

暂无评论...
验证码 换一张
取 消