views:

70

answers:

2

i have a WCf project, when i add the following code to the configuration file (Web.config):

<configuration> <appsettings> <add key="Hello" value="5"/> </appsettings>....

i get this erro whentrying to debug:

"Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information."

when i drop the appsettings, the WCFTestClient opens.

how do i define constants in the web.config if not in that way ?

A: 

I think it the case problem. the Application settings section is defined as

<appSettings>..</appSettings>

I hope you have define the service settings in your web.config

<system.serviceModel>
 <services>..</services>
 <bindings>..</bindings>
 <behaviors>...</behaviors>
</system.serviceModel>
ajay_whiz
the "Add Code" in this site doesn't work well , so i had to write appsettings code myself. i did write appSettings correctly , this is not the problem.
Rodniko
A: 

Solved this problem by putting the AppSettings node as the last node in the section and it works!

<appSettings><add key="hello" value="Monday" /></appSettings></configuration>

funny......

Rodniko