0

I need to shift container registering endpoints (Windsor) from Global.asax file to new project. I'd like to retrieve a section from Web.config file where endpoints are defined but I don't know how to reach that file and section from separate project. I have tried something like this:

 ClientSection clientSection = new MvcApplication().Application.Get((ClientSection) ConfigurationManager.GetSection("system.serviceModel/client"))

but it seems it is wrong path. Any ideas how to copy section from Web.config in one project into configuration file in another?

Cœur
  • 37,241
  • 25
  • 195
  • 267
arth81
  • 229
  • 5
  • 17

1 Answers1

0

Try this code to get client section:

ClientSection clientSection = 
ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
Shetty
  • 1,792
  • 4
  • 22
  • 38
  • but how to refer to the MVC or frm mvc here. In mvc global.asax I was trying smtg like: _container = new WindsorContainer().Install(FromAssembly.Named("Proj.Apllication.Ioc")) but I couldnt add this reference due to the circular dependency ? – arth81 Oct 14 '15 at 12:44
  • not expert in Windsor :) this works fine when I tried in my code asp.NET code – Shetty Oct 14 '15 at 14:44