当错误EDMX文件是在一个单独的项目 [英] Error when edmx file is in a separate project

查看:134
本文介绍了当错误EDMX文件是在一个单独的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,说

指定命名连接或者未在配置中发现,不打算与使用 EntityClient 提供商或无效。

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

我的EDMX文件是在单独的项目,但该项目在其的app.config

My edmx file is in separate project, but that project has connection string in its app.config

什么会导致这个问题?

推荐答案

请确保在app.config是在其中设置为启动项目的项目。

Make sure the app.config is in the project which is set to be the startup project.

如果我理解正确的(我希望我做的!):

IF I understand correctly (I hope I do!):

您有两个项目:

ApplicationServices(启动项目)

ApplicationServices (Startup Project)


  • 的Web.config

EntityContainer相关

EntityContainer


  • MyEdmx.edmx

  • MyEdmx.edmx

App.config中

App.config

在项目启动时,它读取从Web.config文件。

When the project starts up, it reads from the web.config file.

您需要确保连接字符串是在web.config文件中。我一般是从其他项目中删除的app.config如果我不使用他们的计划。

You need to make sure the connection string is in the web.config file. I usually remove the app.config from the other projects if I do not plan on using them.

同时仔细检查ApplicationServices项目引用EntityContainer相关。

Also double check ApplicationServices project references EntityContainer.

这篇关于当错误EDMX文件是在一个单独的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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