![](/img/trans.png)
[英]No connection string named 'CREntities' could be found in the application config file
[英]No connection string named “thenameofmyconnection” could be found in the application config file
我正在使用实体框架和azure,我在Web角色中获得了一个WCF,它使用项目中的方法与实体框架..似乎我将连接字符串放在错误的文件上或者我错误地定义它...它如下:
<connectionStrings>
<!-- Windows Azure SQL Database Connection String -->
<add name="AMTEntitiesContainer"
connectionString="here goes my connection string"
providerName="System.Data.EntityClient" />
</connectionStrings>
这是在我的实体库项目中的app.config文件中...应该进入我的webrole的配置吗? 还是应该进入我的WCF服务?
连接字符串应位于WCF服务的web.config中。 EntityFramework项目将在进程中执行。 WCF服务正在运行。
这对理解这些事情也很有帮助。
我很抱歉这篇文章,我还不能写评论。
如果是与Azure交互的WebService,则需要将其移动到其Web.config中。 如果是应用程序,则还有其他问题。
我有这个,只是因为我错误地创建了我的模型。 我做错了:
var model = new ModelName;
而不是正确地做:
var model = ModelName.Create();
所以这个错误可能会因为这样的简单原因而抛出
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.