System.ComponentModel.DataAnnotations.Schema.TableAttribute 同时存在于EntityFramework.dll和System.ComponentModel.DataAnnotations.dll中
Entity Framework 与 .net4.5 的 System.ComponentModel.DataAnnotations 都有 System.ComponentModel.DataAnnotations.Schema 命名空间。并且都有一些相同的 特性(Attribute), 如:ForeignKeyAttribute, NotMappedAttribute 等。当项目同时引用了 EntityFramework.dll 与 System.ComponentModel.Composition.dll ,你将不能正常使用上面提到的特性。
使用别名,给这两个dll 加一个不同的根。
引用dll, 默认的别名都是 global
1、将 EntityFramework.dll 的别名改为 EF

2、在类的using 区域写入 extern alias EF;
3、using EF::System.ComponentModel.DataAnnotations.Schema; //引用别名加命名空间

4、DbContext更新

System.ComponentModel.DataAnnotations.Schema.TableAttribute 同时存在于EntityFramework.dll和System.ComponentModel.DataAnnotations.dll中的更多相关文章
- 错误 1 类型“System.Web.Mvc.ModelClientValidationRule”同时存在于“c:\Progra型“System.Web.Mvc.ModelClientValidationRule”同时存在
解决方案: step1:首先关闭你应用程序方案,在你保存项目的文件夹下找到ProjectName.csproj ProjectName是你实际的应用程序名称. step2:用文字编辑器打开你找到它找 ...
- SQL 删除存在于A表但是不存在B表中的记录
目的是是的A表和B表某一个列集合相等 delete from A where tagetColumn not in ( select targetColumn from B)
- System.ComponentModel.DataAnnotations.Schema 冲突
System.ComponentModel.DataAnnotations.Schema 冲突 Entity Framework 与 .net4.5 的 System.ComponentModel.D ...
- asp.net 错误 类型"xxxxx"同时存在于"xxx.dll"和"xxxx.dll" 中
http://walttoney.blog.163.com/blog/static/127685797201051112839328/错误 类型“System.Web.UI.ScriptManager ...
- .net 发布程序时出现“类型ASP.global_asax同时存在于...”错误的解决办法
web程序发布后,通过浏览器访问程序显示如下的错误信息: 编译器错误消息: CS0433: 类型“ASP.global_asax”同时存在于“c:\WINDOWS\Microsoft.NET\Fram ...
- CS0433: 类型“Microsoft.Reporting.WebForms.ReportViewer”同时存在于“c:/WINDOWS/assembly/GAC_MSIL/Microsoft.ReportViewer.WebForms/8.0.0.0_ 标签: cassembly
CS0433: 类型“Microsoft.Reporting.WebForms.ReportViewer”同时存在于“c:/WINDOWS/assembly/GAC_MSIL/Microsoft.Re ...
- 发布程序时出现“类型ASP.global_asax同时存在于...”错误的解决办法
web程序发布后,通过浏览器访问程序显示如下的错误信息: 编译器错误消息: CS0433: 类型“ASP.global_asax”同时存在于“c:\WINDOWS\Microsoft.NET\Fram ...
- ArcGIS 开发时,解决__类型“XX”同时存在于“”和“”中__的错误
错误提示:类型“ESRI.ArcGIS.ADF.BaseClasses.BaseCommand”同时存在于“e:\Program Files\ArcGIS\DeveloperKit10.2\DotNe ...
- bit-map再显身手:test.txt中有42亿个无符号整数, 求不存在于test.txt中的最小无符号整数。限制: 可用内存为600MB.
先看看这个题目:test.txt中有42亿个无符号整数, 求不存在于test.txt中的最小无符号整数. 限制: 可用内存为600MB. 又是大数据. 看到42亿, 有灵感没? 要知道, 2的32次方 ...
随机推荐
- 2018-01微信小程序--直播
一. 小程序直播支持的格式 目前小程序支付两种格式直播 1) flv格式直播 2) rtmp格式直播 二. 能够开通小程序直播的行业类目 由于直播需要资质, 并不是每个企业都能够开通小程序直播, 微信 ...
- NORMA2 - Norma [cdq分治]
题面 洛谷 你有一个长度为n的序列,定义这个序列中每个区间的价值是 \(Cost(i,j)=Min(Ai...Aj)∗Max(Ai...Aj)∗(j−i+1)Cost(i,j)=Min(A_{i}.. ...
- 【比赛】NOIP2018 填数游戏
打表找规律.... #include<bits/stdc++.h> #define ui unsigned int #define ll long long #define db doub ...
- urllib的实现---timeout,获取http响应码,重定向,proxy的设置
1.Timeout设置超时 只能修改Socket设置全局Timeout #! /usr/bin/env python3 import socket import urllib.request # ti ...
- input type=file上传控件老问题
// 1.用INPUT控制上传文件时,点击INPUT控件出现文件选择框. // 2.如果在手机上使用时,一般不会出现这种较丑的 // 3.于是就自然想到将控件隐藏,然后用一个按钮代替,点击按钮时在函数 ...
- Building Microservices with Spring Boot and Apache Thrift. Part 2. Swifty services
http://bsideup.blogspot.com/2015/04/spring-boot-thrift-part2.html In previous article I showed y ...
- luogu2643 聪聪可可
题目链接 题意 其实转化之后的题意就是求出树上有多少条路径长度是3的倍数.求答案的时候只要将这个数字除以总路径数量就行了. 思路 考虑点分治.对于当前子树,分别求出出树中每个点到根的路径长度对\(3\ ...
- win10开机自启动
快捷方式复制到win+ R 编辑shell:startup enter后的文件夹中
- python操作excel文件一(xlrd读取文件)
一般做接口测试,会把参数和一些数据放入excel表中,这样就不会重新编译代码,提高效率.一般如何操作呢?接下来跟着步骤一起学习吧 执行步骤: 1.首先要安装 xlrd这个模块,用 pip instal ...
- Educational Codeforces Round 55 (Rated for Div. 2) B. Vova and Trophies
传送门 https://www.cnblogs.com/violet-acmer/p/10035971.html 题意: Vova有n个奖杯,这n个奖杯全部是金奖或银奖,Vova将所有奖杯排成一排,你 ...