DIPTI SHARMA

DIPTI SHARMA

  • NA
  • 17
  • 4.9k

Data Access using Entity framework in Windows Service

Sep 4 2018 11:42 PM
I want to create a windows service with Data Access using Entity Framework - Code first approach. Data Access should be in separate project but same solution. In DbContext file MyContext.cs  this code line is throwing error.
public MyContext()
: base("MydbConn")
The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. >> Configuration system failed to initialize .
May be because, Data Access project is not able to access connection string in App.Config file. 
 

Answers (1)