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 Areas\HelpPage\Views\Help\DisplayTemplatesHelpPageApiModel.cshtml Samples error:
D:\ project \MyWeb\MyWeb.Web\Areas\HelpPage\Views\Help\DisplayTemplates\Samples.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>
Web api help page error CS0012: Type "System.Collections.Generic.Dictionary'2错误的更多相关文章
- 序列化时提示There was an error reflecting type 'System.Collections.Generic.List`1
序列化xml文件到List中,非win10下出现了这个错误,但是在win10下正常.经过仔细的研究,发现是序列化工具类不能使用Static.去掉Static即可.
- Unity3d:Unknown type 'System.Collections.Generic.CollectionDebuggerView'1
问题描述:如图,在调试状态下说:Unknown type 'System.Collections.Generic.CollectionDebuggerView'1<ignore_js_op> ...
- System.ArgumentException: 已添加了具有相同键的项。(An item with the same key has already been added) 在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) 在 System.Web.Mvc.Js
最近将一个项目从ASP.NET MVC 3升级至刚刚发布的ASP.NET MVC 5.1,升级后发现一个ajax请求出现了500错误,日志中记录的详细异常信息如下: System.ArgumentEx ...
- 索引超出了数组界限。 在 System.Collections.Generic.Dictionary`2.Resize
博问:Dictionary 超出了数组界限 异常: Exception type: IndexOutOfRangeException Exception message: 索引超出了数组界限. 在 S ...
- C# System.Collections.Generic.Dictionary
using System; using System.Collections.Generic; public class Example { public static void Main() { / ...
- 【Azure 微服务】Service Fabric中微服务在升级时,遇见Warning - System.Collections.Generic.KeyNotFoundException 服务无法正常运行
问题描述 使用.Net Framework 4.5.2为架构的Service Fabric微服务应用,在升级后发布到Azure Fabric中,服务无法运行.通过Service Fabric Expl ...
- C#编译问题'System.Collections.Generic.IEnumerable' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument
'System.Collections.Generic.IEnumerable<string>' does not contain a definiti ...
- System.Collections.Generic的各容器类的用法
演示System.Collections.Generic的各容器类的用法. 包括:Dictionary,KeyValuePair,SortedDic tionary,SortedList,HashSe ...
- A simple Test Client built on top of ASP.NET Web API Help Page
Step 1: Install the Test Client package Install the WebApiTestClient package from the NuGet Package ...
随机推荐
- PostgreSQL逻辑复制使用记录
之前逻辑复制刚刚出来的时候就使用过,但是没有进行整理,这次一个项目需要逻辑复制的自动迁移,再次拾起逻辑复制. 在此之前有两个疑问: 1)同一个表,既有流复制,又有逻辑复制,这样数据会有两份吗? --不 ...
- Linux:数据流重定向
1)垃圾桶黑洞 /dev/null command > /dev/null 2)stdout与stderr写入同一个文件 command > filename >& comm ...
- 【中文同义词近义词】词向量 vs 同义词近义词库
方案一:利用预训练好的词向量模型 优点: (1)能把词进行语义上的向量化(2)能得到词与词的相似度 缺点: (1)词向量的效果和语料库的大小和质量有较大的关系(2)用most_similar() 得到 ...
- 理解Scala中的Extractor
引言 最近抱着<Programming in Scala>(英文第二版)在死啃Scala.在阅读第26章Extractor时,偶然在Stack Overflow上搜到一个帖子<Sca ...
- 如何去访问win8系统的共享文件夹
关于共享,看过不少的贴子,觉得搞得很复杂.我看起来也很头痛.晕头转向的.其实我们作为家庭用户来说,不想搞得那么复杂,我们只要能做到能够从一台电脑访问另一台电脑的共享文件夹就可以了,这样我们就可以任意从 ...
- 编程之美Ex2——字符串移位包含的问题
给定两个字符串s1,s2,要求判定s2是否能够被s1做循环移位得到的字符串包含. 例如, 给定s1=AABCD和s2=CDAA,返回true: 给定s1=ABCD和s2=ACBD,返回false. 法 ...
- 【JPA 级联保存/级联删除】@OneToMany (双向) 一对多【转】
[http://blog.sina.com.cn/s/blog_625d79410101dbdd.html] 看过前两篇帮助文档 [JPA] @OneToOne 单向 和 [JPA]@OneToO ...
- BZOJ2330 SCOI2011 糖果 【差分约束】
BZOJ2330 SCOI2011 糖果 Description 幼儿园里有N个小朋友,lxhgww老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果.但是小朋友们也有嫉妒心,总是会提出一 ...
- Robot Framework-断言函数
测试用例的目的是要验证一些操作否符合我们的预期结果,所以在测试用例中,断言函数是必不可少的一项.我们做的每一步操作都会有预期的结果,为了保证操作得到的结果符合预期,我们需要在测试用例中添加断言,来保证 ...
- Sprint第一个冲刺(第十天)
一.Sprint介绍 更新工程部署文件:实现了云端登录:设计经营情况以及数据分析界面. 实验截图: 任务进度: 二.Sprint周期 看板: 燃尽图: