C # Unrecognized configuration section system. servicemodel

Source: Internet
Author: User

The company's project is used in the old project.. NET Framework 2.0 environment, but we are developing and using vs2008, so when creating a new application, set the environment. net frameword2.0.

This is a client interfaceProgramTo the web service.

However, the following error occurs during running:

 

Code
2008 - 11 - 18   18 : 36 : 44 , 093 [ 352 ] Debug utrial. yhdclient. mainform [( Null )] < ( Null ) >   - System. configuration. configurationerrorsexception: configuration system failed to initialize ---> System. configuration. configurationerrorsexception: Unrecognized configuration section system. servicemodel. (D: \ CMI \ tmsexe \ yhdclient.exe. config line 8 )
At system. configuration. configurationschemaerrors. throwiferrors (Boolean ignorelocal)
At system. configuration. baseconfigurationrecord. throwifparseerrors (configurationschemaerrors schemaerrors)
At system. configuration. baseconfigurationrecord. throwifiniterrors ()
At system. configuration. clientconfigurationsystem. ensureinit (string configkey)
--- End of inner exception stack trace ---
At system. configuration. configurationmanager. getsection (string sectionname)
At system. xml. serialization. xmlserializercompilerparameters. Create (string location)
At system. xml. serialization. tempassembly... ctor (xmlmapping [] xmlmappings, type [] types, string defaultnamespace, string location, evidence evispace)
At system. xml. serialization. xmlserializer. frommappings (xmlmapping [] mappings, type)
At system. Web. Services. Protocols. soapclienttype.. ctor (type)
At system. Web. Services. Protocols. soaphttpclientprotocol.. ctor ()
At *** . Cmiservice. cmiclientservice... ctor () In D: \ CMI \ tmsexe \ Web references \ cmiservice \ reference. CS: Line 97
At *** . Mainform. login () In D: \ CMI \ tmsexe \ form \ mainform. CS: Line 67

 

After searching the Internet, just comment out a section of the configuration file, as shown below:Code

The configuration file is as follows:

Code
<? XML version = " 1.0 " Encoding = " UTF-8 "   ?>
< Configuration >
< Configsections >
< Sectiongroup name = " Applicationsettings " Type = " System. configuration. applicationsettingsgroup, system, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089 "   >
< Section name = " * **. Properties. Settings " Type = " System. configuration. clientsettingssection, system, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089 " Requirepermission = " False "   />
</ Sectiongroup >
</ Configsections >
<! -- Comment out this section
< System. servicemodel >
< Bindings />
< Client />
</ System. servicemodel >
-->
< Applicationsettings >
<*** . Properties. Settings >
< Setting name = " **** "
Serializeas = " String " >
< Value > HTTP: // Www. *****. com/*** service. asmx </value>
</ Setting >
< /* **. Properties. Settings>
</Applicationsettings>
</Configuration>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.