配置部分' system.ServiceModel'无法阅读,遗失部分声明

时间:2016-05-10 20:14:32

标签: c# asp.net web-config

我正在关注http://docs.nuget.org/create/hosting-your-own-nuget-feeds的文档以设置Nuget Server。我已经遵循了所有步骤,但是当我运行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>

1 个答案:

答案 0 :(得分:1)

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

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