Why i got this error ? No connection string named '' could be found in the application config file [closed]

StackOverflow https://stackoverflow.com/questions/16587213

  •  29-05-2022
  •  | 
  •  

質問

I have a DAL project using entity framework. I refer the project into BAL project, when i execute the BAL project. i got the error like

"No connection string named 'StudentEntities' could be found in the application config file."

Then i copied the DAL project connection string and the paste the BAL project web config.That time my error would fixed. but my question is.

We exexute the BAL, the BAl call the DAL, already DAL have connection string the why we got this error ?

Why Microsoft did like this ?

Is anything reasons ?

Note: This error discussed more times in stackoverflow but my question is different from other

役に立ちましたか?

解決

Because configuration is read from the config file of the entry project, which in this case BAL. Otherwise you would not be able to use your DAL project in different projects with different connection strings

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top