-1

I am trying to write a WCF service that links another project's App.config file. This is a .net 3.5 project and when I try to use:

SystemsConfigurationHandler systemsSection = Configuration.WebConfigurationManager.GetSection("thirdPartySystemsSection") as SystemsConfigurationHandler;

But it still doesn't know what WebConfigurationManager is.

Line of code having the problem.

"The type or namespace name 'Configuration' doesnt not exist in the namespace 'System.Web'"

yet looking in the object browser its clearly there. How can I fix this?

System.Web.Configuration shows WebConfigurationManager there.

Also I am trying to browse a linked App.config file from another project to give an idea of what I am doing.

Tyler Buchanan
  • 311
  • 1
  • 4
  • 18

1 Answers1

1

Why are you using WebConfigurationManager?

Using WebConfigurationManager is the preferred way to work with configuration files related to Web applications. For client applications, use the ConfigurationManager class.

Note that you also can't just access another project's .config file. You could try this.

Community
  • 1
  • 1
BCdotWEB
  • 1,009
  • 1
  • 14
  • 35
  • I tried using ConfigurationManager but it only shows my connection strings and not everything from the App.config file when I explore that code. and I linked the App.config file to my project. so its basically just a copy or at least that is what I had believed. – Tyler Buchanan Oct 27 '14 at 16:23