或者App.Config文件中没有appSettings这一节?

解决方案 »

  1.   

    不会吧,我的App文件就在那个路径下啊
      

  2.   

    xml文件内容是什么,还有错误信息到底是什么
    什么都不说我怎么知道你怎么了
      

  3.   

    xmlDoc.SelectSingleNode("appSettings")  这个结果是null  后面不能在获取值 ,检查下了
      

  4.   

    未将对象引用到实例,就是某个变量为NULL了
    你到底是SelectSingleNode("appSettings")为NULL
    还是.ChildNodes为NULL啊
      

  5.   

    我把App文件贴出来给你看下:
    <?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="ConStringEncrypt" value="false"/>
        <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
        <add key="ConnectionString" value=""/>
        <add key="AppName" value="OA"/>
      </appSettings>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                <message clientCredentialType="UserName" algorithmSuite="Default"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>  </system.serviceModel>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
    </configuration>
      

  6.   

    不会吧,我的App文件就在那个路径下啊我把App文件贴出来给你看下:<?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="ConStringEncrypt" value="false"/>
        <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
        <add key="ConnectionString" value=""/>
        <add key="AppName" value="OA"/>
      </appSettings>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                <message clientCredentialType="UserName" algorithmSuite="Default"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>  </system.serviceModel>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
    </configuration>
      

  7.   

    我把App文件贴出来给你看下:<?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="ConStringEncrypt" value="false"/>
        <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
        <add key="ConnectionString" value=""/>
        <add key="AppName" value="OA"/>
      </appSettings>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
                <message clientCredentialType="UserName" algorithmSuite="Default"/>
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>  </system.serviceModel>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
    </configuration>