1

Here is my simple project structure - the idea is to acess the entity information in console application

Sln - Data access layer (entity framework and metadata) and repository - Service layer to get list of all items in each entity - Console project to access service layer

Am using windsor castle and so my code in console is

static void Main(string[] args)
{

    // Registering
    var container = new WindsorContainer();
    container.Register(Component.For<IRefRepository>().ImplementedBy<RefRepository>());
    container.Register(Component.For<IReflService>().ImplementedBy<RefService>());
    container.Register(Component.For<RefEntities>());            


    // Resolving
    var list = container.Resolve<IRefService>();

    list.GetCountries();
}

I am getting the following error on

var list = container.Resolve();

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

My app.config generated by EF is in Data access layer.

Thanks , any help?

Karthick
  • 39
  • 2
  • 8
  • config goes in the executing project, so it goes in your console app. – Crowcoder Apr 01 '15 at 11:21
  • Have you seen [this](http://stackoverflow.com/questions/3491165/the-specified-named-connection-is-either-not-found-in-the-configuration-not-int)? – Mark C. Apr 01 '15 at 11:22

1 Answers1

0

You need to copy the relevant config sections of EF from your data layer config file to your console application config file.

Praveen Paulose
  • 5,741
  • 1
  • 15
  • 19