配置文件应该是没问题的,因为同一个文件一个winform的程序就可以顺利的把remoting 
开启可windows服务却不行,我把那个配置文件放在服务所在的那个目录里,应该也不会是路径的问题。在服务里的调用代码:
RemotingConfiguration.Configure(@"Service.exe.config");
配置文件:
<configuration>
    <appSettings>
<add key="connStr" value="server=192.168.0.111;database=111;uid=sa;pwd=a;"></add>
    </appSettings>
    <system.runtime.remoting>
    <application>
      <service>
        <wellknown mode="SingleCall" type="CCXX.QBCJFX.Marshalc1, Marshalc1" objectUri="Marshalcs.soap" />
      </service>
  <channels>
    <channel port="8087" ref="http"/>
<channel port="8086" ref="Tcp"/>
  </channels>
    </application>
  </system.runtime.remoting>
</configuration>

解决方案 »

  1.   

    你把那个.exe.config copy 到 %system32%下
      

  2.   

    确实如楼上所说,但能否说说为什么经常取得的路径是%system32%下
      

  3.   

    因为服务是被%system32%\svchost.exe 启动的
      

  4.   

    不放在system32下也可以,但你必须指定路径:
    Dim t As Type = Me.GetType
    Dim a As System.Reflection.Assembly = t.Assembly
    Dim cfg As String = a.Location & ".config"
    System.Runtime.Remoting.RemotingConfiguration.Configure(cfg)