我正在一个解决方案(一个笑话网站)工作。解决方案有2个项目:
>模型(C#类库)
> MVC 3空应用程序
Could not load file or assembly ‘System.Data.Entity,Version=4.0.0.0,
Culture=neutral,PublicKeyToken=31bf3856ad364e35’ or one of its
dependencies. The system cannot find the file specified
从Error消息可以看出,我已经将System.Data.Entity添加到MVC 3应用程序的web.config中。
无论我做什么,我似乎无法修复错误!我已经为Entity类,HomeController和Index.cshtml添加了使用语句。
解决方法
要使用ASP.NET MVC 3使用外部实体框架模型(例如嵌入到DLL中),您必须:
>添加以下对MVC项目的引用:System.Data.Entity(版本4.0.0.0,Runtime v4.0.30319)
>在web.config中添加以下行
…
< compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Data.Entity,Culture=neutral,PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。