简体   繁体   English

无法读取配置节'程序集',因为它缺少节声明

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

I use asp.net 4, I have some strange problem with my web.config, I receive this error. 我使用asp.net 4,我的web.config有一些奇怪的问题,我收到此错误。 It seems that inside the <compilation> section there is some not well formatted code. 似乎在<compilation>部分内部有一些格式不正确的代码。

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, PublicKeyToken=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>标签:

<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). 要了解有关遇到的问题的更多信息,请打开“Web.config”文件并分析VS“错误列表”窗口(查看 - >错误列表)。

See the http://msdn.microsoft.com/en-us/library/ms178685.aspx MSDN article to learn more about Web.config file structure. 有关Web.config文件结构的详细信息,请参阅http://msdn.microsoft.com/en-us/library/ms178685.aspx MSDN文章。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法读取配置节“ serviceAutoStartProviders”,因为它缺少节声明 - The configuration section 'serviceAutoStartProviders' cannot be read because it is missing a section declaration 无法读取配置节&#39;configsections&#39;,因为它缺少节声明 - The configuration section 'configsections' cannot be read because it is missing a section declaration 无法读取配置节&#39;entityFramework&#39;,因为它缺少节声明 - The configuration section 'entityFramework' cannot be read because it is missing a section declaration 配置部分&#39;services&#39;无法读取,因为它缺少部分声明 - the configuration section 'services' cannot be read because it is missing a section declaration 无法读取配置节'customErrors',因为它缺少节声明 - The configuration section 'customErrors' cannot be read because it is missing a section declaration 无法读取配置节&#39;connectionStrings&#39;,因为它缺少节声明 - The configuration section 'connectionStrings' cannot be read because it is missing a section declaration 无法读取配置节&#39;system.web.webPages.razor&#39;,因为它缺少节声明 - The configuration section 'system.web.webPages.razor' cannot be read because it is missing a section declaration 无法读取配置节“ system.ServiceModel”,缺少节声明 - The configuration section 'system.ServiceModel' cannot be read, missing section declaration 配置部分&#39;log4net&#39;缺少部分声明 - Configuration section 'log4net' is missing a section declaration 配置部分“appSettings”有一个意外声明 - The configuration section 'appSettings' has an unexpected declaration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM