System.ComponentModel.DataAnnotations.Schema 冲突
来源:互联网 发布:网络黄牛是什么意思 编辑:程序博客网 时间:2024/05/29 07:27
System.ComponentModel.DataAnnotations.Schema 冲突
Entity Framework 与 .net4.5 的 System.ComponentModel.DataAnnotations 都有 System.ComponentModel.DataAnnotations.Schema 命名空间。并且都有一些相同的 特性(Attribute), 如:ForeignKeyAttribute, NotMappedAttribute 等。当项目同时引用了 EntityFramework.dll 与 System.ComponentModel.Composition.dll ,你将不能正常使用上面提到的特性。
使用别名,给这两个dll 加一个不同的根。
引用dll, 默认的别名都是 global
将 EntityFramework.dll 的别名改为 EF
在类的using 区域写入 extern alias EF;
*using EF::System.ComponentModel.DataAnnotations.Schema 引用别名加命名空间
* *
0 0
- System.ComponentModel.DataAnnotations.Schema 冲突
- using System.ComponentModel.DataAnnotations
- System.ComponentModel.DataAnnotations dll中标签的用法
- “CreateRiaClientFilesTask”任务意外失败。 未能加载文件程序集“System.ComponentModel.DataAnnotations 处理办法
- 第6章 数据注解 System.ComponentModel.DataAnnotations 、注解后台原理、自定义验证ValidationAttribute、IValidatableObject
- System.Diagnostics System.ComponentModel
- [System.ComponentModel.DesignerCategory("Code")]
- System.ComponentModel.Component入门
- System.ComponentModel.Component简介
- [System.ComponentModel.DataObject]
- System.ComponentModel.Component入门
- System.ComponentModel.Win32Exception解决方案
- 错误:类型 System.ComponentModel.ISite ...
- System.ComponentModel.ComponentResourceManager resources作用?
- System.ComponentModel.Win32Exception: 拒绝访问。
- [System.ComponentModel.DesignerCategory("Code")]的含义
- System.ComponentModel.AsyncOperation类 - 这个类很特别
- 类型“System.ComponentModel.PropertyChangedEventManager”未标记为可序列化
- android类之Pattern
- H264视频的sps和pps解析和哥伦布编码
- hdu 1022 Train Problem I
- 杭电 2026 首字母变大写
- 【玩转cocos2d-x之二十二】多线程和同步02-售票
- System.ComponentModel.DataAnnotations.Schema 冲突
- ADO.NET (二)—— ADO和ADO .NET对比
- Zookeeper在hbase集群的作用
- 【第四篇章-android平台MediaCodec】解决Observer died. Quickly, do something, ... anything...
- 模拟iOS网络环境
- git快速入门
- 【玩转cocos2d-x之二十三】多线程和同步03-图片异步加载
- 关于验证码的那点事
- Android 四大组件学习之Service二