博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[转]:No connection string named ‘AnyEntities’ could be found in the application config file
阅读量:4968 次
发布时间:2019-06-12

本文共 1124 字,大约阅读时间需要 3 分钟。

From: 

While working on an ASP.NET MVC application I encountered the following error. It clearly says that some connection string is missing in the configuration file.

clip_image002

Well I have refactored the application following the onion architecture and there is nothing related to database exist in the MVC project. Project structure looks like follows:

clip_image004

The Entity Framework is part of the infrastructure project and in its App.Config file, there is an entry of connection string as follows:

clip_image006

Even though connection is present in the project which is dealing with the database, error is thrown. The reason behind this is, the MVC project is a startup project and the infrastructure project is not a startup project. We need to have connection string in the configuration file of the startup project. In this case startup project is MVC project, so to solve this error we need to copy IndiaMP connection string to Web.config of MVC project. After doing that you should not get the above error.

Solution: Copy connection string to configuration file of startup project.

Happy Coding

转载于:https://www.cnblogs.com/Blackeye286/p/4311003.html

你可能感兴趣的文章
centos iptables
查看>>
Mysql数据库日志
查看>>
Python基础-数据类型
查看>>
unity3d 移动与旋转 2
查看>>
MyEclipse安装Freemarker插件
查看>>
php 文件下载
查看>>
寻找二叉查找树中比指定值小的所有节点中最大的那个节点
查看>>
如何设置输入框达到只读效果
查看>>
RT3070 USB WIFI 在连接socket编程过程中问题总结
查看>>
MIS外汇平台荣获“2013年全球最佳STP外汇交易商”
查看>>
LeetCode 题解之Add Digits
查看>>
高性能分布式计算与存储系统设计概要(下篇)
查看>>
案例------冒泡排序
查看>>
Hexo中添加emoji表情
查看>>
setsocketopt() usage
查看>>
Xml处理工具类(Jdom)
查看>>
返回文件路径中的想要的值
查看>>
hdu1502 , Regular Words, dp,高精度加法
查看>>
maven常用配置信息和常量
查看>>
20120227_CET6
查看>>