所以刚刚下载了一个新项目的源代码,该项目在其他开发人员的盒子上构建并运行良好。我得到的错误:奇怪“ConnectionString属性尚未初始化。”错误
The ConnectionString property has not been initialized.
我能够使用连接字符串在我的web.config通过SQL Server Management Studio中连接到数据库没有问题。
抛出此错误的库的源代码不可用。
该项目是一个ASP.NET MVC项目与在Web.config以下值
<connectionStrings>
<add name="DbConnection" connectionString="Data Source=la-foo-server\development,1444;database=mydb;user id=myId;password=myPassword;" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="ConnectionStringName" value="DbConnection" />
</appSettings>
我已经尝试添加一个app.config到我的ASP.NET网站只是在bin和根因为某些原因,没有源代码的lib正在尝试读取App.Config并忽略Web.config。
StackOverflow的解决方案,具有不帮助:
- How to fix "The ConnectionString property has not been initialized"
- The ConnectionString property has not been initialized error
- Solve the error "The ConnectionString property has not been initialized."?
开发人员对在Windows 8.1环境中,这同样的情况有一天,他转移到Windows 7环境并且错误得到修复。我正在使用Windows 7专业版,所以我不知道这是否与我的.NET框架安装问题。
ASP.NET MVC网站的目标是版本4.0。我的大多数其他项目,如果没有问题,所有的工作都瞄准.NET 4.5
是否可以通过ODBC驱动程序使用此连接字符串信息来连接数据库。 – 2014-10-09 01:30:46
我能够通过Sql Management Studio连接到数据库,应用程序甚至没有找到配置文件中的连接字符串就是我认为错误是。 – 2014-10-09 01:31:58
您的应用程序的应用程序池是否指向目标框架4.0。 – 2014-10-09 01:36:40