![](/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.