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 ...
 
随机推荐
- functools 和 itertools
			
functools 补充 1 wraps 在编写装饰器时,在实现前加入 @functools.wraps(func) 可以保证装饰器不会对被装饰函数造成影响.wraps 保存被装饰函数的原信息 def ...
 - 使用treemap 遍历map参数
			
遍历格式 XXX=123&XXX=456.....参数为map treemap是一个有序的key-value集合,它是通过红黑树实现的 TreeMap<String, String> ...
 - FFmpeg再学习 -- FFmpeg解码知识
			
继续看雷霄骅的 课程资料 - 基于FFmpeg+SDL的视频播放器的制作 前面用了五个篇幅来讲 FFmpeg,其主要目的是为实现将图片转视频的功能. 总的来说,对于 FFmepg 多少有一些了解了.但 ...
 - vuex秘籍
			
vue项目开发中,大型项目一般vuex所需要存储的状态一般都很都,这时,我们便需要进性模块化划分,然后 再页面中采用映射来实现state的调用: 目录一般如下: store为总的状态库存放文件. mo ...
 - 掌握Git撤销操作,随心所欲控制文件状态
			
本文主要讨论和撤销有关的 git 操作.目的是让读者在遇到关于撤销问题时能够方便迅速对照执行解决问题,而不用去翻阅参数繁多的 git 使用说明. 一开始你只需了解大致功能即可,不必记住所有命令和具体参 ...
 - http_server实例代码
			
from socket import * def handleClient(connfd): print("-----") request = connfd.recv(4096) ...
 - C++ 项目经验总结:程序严谨性(一)
			
作者:JK 时间:2015/09/24 特别说明:版权所有,转载请注明出处: 最近笔者在参与项目时,遇到了一些很奇特的问题,程序运行正常,产生的结果异常,程序功能是对当天的数据进行统计,数据里有可能有 ...
 - Chrome 插件下载
			
这里推荐几个下载chrome扩展的网站 http://www.cnplugins.com/index.html 分类全,没有搜索 http://www.chromein.com/ 有搜索,推荐使用 h ...
 - BZOJ5450: 轰炸(水题,Tarjan缩点求最长路)
			
5450: 轰炸 Time Limit: 10 Sec Memory Limit: 256 MBSubmit: 43 Solved:18[Submit][Status][Discuss] Desc ...
 - flash 一直在最上方,z-index无效
			
设置embed的透明度 wmode="transparent" <embed src="http://player.youku.com/player.php/sid ...