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 ...
随机推荐
- Confluence 安装
一.事前准备 1.jdk安装:5.8.10的jdk至少是7,其中7中还有很多官网是不建议的,这儿选中jdk-7u79 二.安装Confluence 双击atlassian-confluence-5.8 ...
- Git远程操作详解(转)
转自:http://www.ruanyifeng.com/blog/2014/06/git_remote.html Git远程操作详解 Git是目前最流行的版本管理系统,学会Git几乎成了开发者的 ...
- 联想THINKPAD E40的快捷键怎么关闭?哪些F1 F2 F3的键我需要用到 但是每次都按FN 太烦人了
1.开机时,按F1进入BIOS,依次选择CONFIG--Keyboard/Mouse,2.在Change to "f1-f12 keys"选项中,更改设置为Legacy或者Defa ...
- RDS 在线DDL诡异报错ERROR 1062 (23000): Duplicate entry
RDS上执行报错如下: MySQL [ad_billing]> ALTER TABLE ad_spending ADD COLUMN impr bigint(20) NOT NULL DEFAU ...
- boost库之udp广播实例
//UdpLinkServer.h //udp服务 #pragma once #include <boost/asio/ip/tcp.hpp> #include <boost/asi ...
- C# 加密狗 超级狗 加密程序 程序授权示例 程序授权验证
本篇针对超级狗进行讲解,对应的超级狗套件的工具包版本为2.4版本.超级狗图片如下: 主要包含两个狗,一个是超级狗,一个是开发狗,在本博文中都是必须的.首先先安装光盘中的开发套间. 接下来就开始演示一个 ...
- 设计模式 - 代理模式(Proxy Pattern)
一.引言 在软件开发过程中,有些对象有时候会由于网络或其他的障碍,以至于不能够或者不能直接访问到这些对象,如果直接访问对象给系统带来不必要的复杂性,这时候可以在客户端和目标对象之间增加一层中间层,让代 ...
- windows之死活格式化不了D/E/F盘
唉 见教程:Win10系统无法格式化电脑D盘的解决方法
- Android学习笔记之Android Studio下创建menu布局文件
1.创建menu文件夹 Android Studio项目中如果没有menu文件夹,在res文件夹右键,new-Android resource directory: 则会弹出下图对话框,在Resour ...
- [转](阿里笔试)使用多线程和sleep函数生成字符串的伪随机排列
http://blog.csdn.net/jiaowopan/article/details/12009079 C/C++(Linux平台) 注意编译连接时需要链接pthread库,即g++ XX.c ...