我有3层结构DataAccessLayer,BusinessLogicLayer和网站项目。网站未从web.config获取连接字符串。它正在搜索的app.config
在我DataAccessLayer我已经使用F#库项目,ConnectionString的从app.config文件访问
F#代码 -
type dbSchema = SqlDataConnection<"","MyConnection">
let connectionString = System.Configuration.ConfigurationManager.ConnectionStrings. ["MyConnection"].ConnectionString
的App.config码 -
<connectionStrings>
<add name="MyConnection" connectionString="Data Source=MyServer;Initial Catalog=MyDB;Persist Security Info=True;User ID=sa;Password=xyz;" providerName="System.Data.SqlClient"/>
</connectionStrings>
现在我有给在网站BusinessLogic和网站项目的这个DLL的参考。
我打电话BusinessLogicLayer的一个函数来获取数据 -
VAR MyDataList = BusinessLogic.GetAllData()ToList()。
现在的问题是,该网站是搜索在app.config文件,而不是web.config中的ConnectionString。我希望它采取从web.config中
你的app.config是你的“DataAccessLayer”项目是什么呢? – samar
F#项目运行在它自己的进程中吗?如果一切从IIS运行,它应该从web.config读取。你肯定你有'
oleksii
是这部分在web.config中 – user1696632