System.ComponentModel.DataAnnotations.Schema未找到 [英] System.ComponentModel.DataAnnotations.Schema not found

查看:691
本文介绍了System.ComponentModel.DataAnnotations.Schema未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,在Visual Studio 2012,涉及到System.ComponentModel.DataAnnotations.Schema命名空间。它告诉我,ForeignKeyAttribute不能得到解决,在过去的解决办法是添加using语句被注释掉如下。 VS2012无法解析架构命名空间VS2010能。在这将是导致此问题的最新的.Net版本有什么改变?如果是这样,我该如何解决它们?

I am running into an issue in Visual Studio 2012 that involves the System.ComponentModel.DataAnnotations.Schema namespace. It tells me that the ForeignKeyAttribute cannot be resolved, the solution in the past was to add the using statement that is commented out below. VS2012 can't resolve the Schema namespace as VS2010 was able to. Has anything changed in recent .Net releases that would be causing this problem? If so, how do I work around them?

推荐答案

你确定你的目标.NET 4.5框架。 <一href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.schema.foreignkeyattribute.aspx">ForeignKeyAttribute仅在.NET 4.5可

Are you sure you are targeting .NET 4.5 Framework. ForeignKeyAttribute is only available in .NET 4.5

这篇关于System.ComponentModel.DataAnnotations.Schema未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆