zoukankan      html  css  js  c++  java
  • Web api help page error CS0012: Type "System.Collections.Generic.Dictionary'2错误

    1、在asp.net Boilerplate项目中,Abp.0.12.0.2,.net framework4.5.2。下载后添加了webApi的helpPage功能,调试出现错误。

    dubug : at AreasHelpPageViewsHelpDisplayTemplatesHelpPageApiModel.cshtml Samples error:
    D: project MyWebMyWeb.WebAreasHelpPageViewsHelpDisplayTemplatesSamples.cshtml (6): error CS0012: Type "System.Collections.Generic.Dictionary'2 <T0,T1>" defined in the Assembly that is not referenced. You must add the assemblies "System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" reference.

    解决方法:在 Web.config, node <system.web> <assemblies>, adding
    <add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    解决:http://www.lyalin.com/2014/04/25/the-type-system-object-is-defined-in-an-assembly-that-is-not-reference-mvc-pcl-issue/ 

    2、还是1的项目,debug时候正常,但发布到iis时候出现错误:

    编译错误

    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 

    编译器错误消息: CS0012: 类型“System.Object”在未被引用的程序集中定义。必须添加对程序集“System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”的引用。

    解决方法:在web.config中,node <system.web> <assemblies>, adding

    <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    效果:

    <system.web>
        <!--<trust level="Full" />-->
        <globalization culture="auto" uiCulture="auto"/>
        <compilation debug="true" targetFramework="4.5.2">
          <assemblies>
            <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            <add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </assemblies>
        </compilation>
         
        <httpRuntime/>
        <customErrors mode="Off"/>
        <pages controlRenderingCompatibilityVersion="4.0"/>
      </system.web>
  • 相关阅读:
    【BZOJ 3309】DZY Loves Math
    【51Nod 1239】欧拉函数之和
    【51Nod 1244】莫比乌斯函数之和
    莫比乌斯反演与杜教筛
    【BZOJ 3993】【SDOI 2015】星际战争
    【BZOJ 3876】【AHOI 2014】支线剧情
    【hihoCoder 1454】【hiho挑战赛25】【坑】Rikka with Tree II
    【BZOJ 1061】【Vijos 1825】【NOI 2008】志愿者招募
    【BZOJ 1016】【JSOI 2008】最小生成树计数
    【BZOJ 1005】【HNOI 2008】明明的烦恼
  • 原文地址:https://www.cnblogs.com/lenmom/p/9209242.html
Copyright © 2011-2022 走看看