实体框架引用在调试和发布版本之间丢失 [英] Entity Framework References go missing between debug and release build
问题描述
我正在使用visual studio 2013,很高兴提供任何代码,但是我不知道将是最相关的。
我遇到的一些错误:
在Holds.Context.cs
中的名称空间System.Data中不存在类型或命名空间名称Entity(您缺少程序集引用?)类型或命名空间名称DbContext在Holds.Context.cs
中找不到(您是否缺少using指令或程序集引用?)找不到类型或命名空间名称DbSet(您是否缺少using指令或程序集引用? )在Holds.Context.cs
感谢任何可以提供的指导。
切换到发布模式,然后在问题项目上重新安装实体框架,在我的情况下修复了这个问题。
There must be something that I don't understand in the difference between debug builds and release builds and its use of references. I'm using Entity Framework 6 to connect to a database that has previously been set up. I am able to successfully build and run the project while it is in Debug mode. If I change it to release mode I instantly get build errors indicating that the namespaces and types that were just there can no longer be found. I checked and as far as I can tell they both target framework .Net 4.5 which I saw may have been an issue for some other people. I see no difference in what is listed under references in my solution explorer.
I'm using visual studio 2013. Happy to provide any code but I don't know what would be most relevant.
Some of the errors that I'm getting:
The type or namespace name 'Entity' does not exist in the namespace System.Data' (are you missing an assembly reference?) in Holds.Context.cs
The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) in Holds.Context.cs
The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?) in Holds.Context.cs
Thanks for any guidance that can be provided.
Switching to release mode then re-installing entity framework on the problem project fixed this issue in my case.
这篇关于实体框架引用在调试和发布版本之间丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!