Lev*_*bit 0 entity entity-framework
我的解决方案中有两个项目.一个实现了我的业务逻辑,并定义了实体框架的实体模型.当我想在另一个项目中使用这个项目中定义的类时,我在运行时遇到了一些问题.实际上,最令人担忧的是为什么我无法从其他项目中实例化我所谓的TicketEntities(ObjectContext)对象?当我发现以下异常时:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
我发现它刹车了:
public partial class TicketEntities : global::System.Data.Objects.ObjectContext
{
public TicketEntities() :
base("name=TicketEntities", "TicketEntities")
{
this.OnContextCreated();
}
Run Code Online (Sandbox Code Playgroud)
异常:无法加载指定的元数据资源.只是为了提醒你从原始项目中完成工作.
您需要将原始app.config或web.config中的Connection字符串复制到新项目中的相应app.config/web.config中.
一切都应该有效.
亚历克斯
| 归档时间: |
|
| 查看次数: |
679 次 |
| 最近记录: |