2017년 6월 7일 수요일

C#, MVC : in the application's configuration file does not contain the required providerName attribute

MVC 에서 DB 연결을 시도 했더니...

"in the application's configuration file does not contain the required providerName attribute"


... 라는 오류가 난다.

살짝 짜증이 나지만, 컴퓨터 잘못이 아니니, 일단 "Web.config" 를 열어본다.
아마 이런식으로 되어 있을 텐데...


여기에 "providerName" 이 빠져 있어서 그런것이다.
일반적으로 "System.Data.SqlClient" 를 사용하고 EntityFramework 를 사용할 때는 "System.Data.EntityClient" 를 사용한다고 하던데... 그냥 "System.Data.SqlClient" 만 써도 다 되는 것 같다.


하여간 "ConnectionStrings" 에 providerName="System.Data.SqlClient" 를 추가해 주면 오류가 해결된다.