【问题标题】:The configuration section 'system.ServiceModel' cannot be read, missing section declaration无法读取配置部分“system.ServiceModel”,缺少部分声明
【发布时间】:2017-10-09 20:18:19
【问题描述】:

我正在按照http://docs.nuget.org/create/hosting-your-own-nuget-feeds 的文档设置 Nuget 服务器。我已经按照所有步骤操作,但是当我运行 VS 时,我得到了上面的错误。从错误中我错过了一个部分,但是我错过了哪个部分以及如何添加该部分。我搜索了堆栈和谷歌,但无法找到答案。这是 web.config 的代码

?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5.2"/>
      <httpRuntime targetFramework="4.5.2"/>
    </system.web>
  <appSettings>
    <add key ="packagePath" value="E:\HostedNugetServer"/>
    </appSettings>
  <system.ServiceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    </system.ServiceModel>
</configuration>

【问题讨论】:

    标签: c# asp.net web-config


    【解决方案1】:

    这可能只是您帖子中的一个错字,但您的系统服务模型声明应该在 serviceModel 上使用小写的“s”。

    <system.serviceModel>
         <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    </system.serviceModel>
    

    【讨论】:

    • 如果这解决了问题,您应该将 abrown 的答案标记为正确,@Aaron。
    猜你喜欢
    • 2011-09-16
    • 2013-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多