这是远程对象
Public Class RemoteObject
    Inherits MarshalByRefObject    'return the name of the current application domain
    Public Function GetActiveDomain() As String        Return AppDomain.CurrentDomain.FriendlyName
    End Function
End Class这是SimpleClient的app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="SimpleClient">
<client url="tcp://localhost:8080/SimpleServer">
<activated type="RemoteObjects.RemoteObject,RemoteObjects"/>
</client>
<channels>
<channel ref="tcp client"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
这是一个简单的类
这是调用
 RemotingConfiguration.Configure("SimpleClient.exe.config")
 Dim RemoteObj As New RemoteObjects.RemoteObject //就这句报错了
高手帮忙看下,发了三个贴子了,没分了。。

解决方案 »

  1.   

    错误名称:总是报找不到服务
    <configuration>
    <system.runtime.remoting>
    <application name="SimpleServer">
    <service>
    <actived type="RemoteObjects.RemoteObject,RemoteObjects"/>
    </service>
    <channels>
    <channel ref="tcp server" port="8080"/>
    </channels>
    </application>
    </system.runtime.remoting>
    </configuration>这是服务器端的app.config
    多谢了
      

  2.   

    你服务器用什么承载啊??WinForms?Console?程序不会自动加载app.config里remoting的内容的。
    你必须在服务器中自己调用
    RemotingConfiguration.Configure("YourServerApp.exe.config")
      

  3.   

    是winform
    服务器端是这样写的:
     Private Sub HostForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            RemotingConfiguration.Configure("SimpleServer.exe.config")
        End Sub
      

  4.   

    你把 ref="tcp" 和 ref="tcp server" 改为ref="tcp" 看看。如果可以的话,把<application name="SimpleServer">的name去掉啦。很久没用Remoting了。activated对象的uri也忘记掉了。
      

  5.   

    现在在看remoting,糊里糊涂的。
      

  6.   

    哪个高手能把配置文件略述一下
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
       <system.runtime.remoting>
          <application name="SimpleClient">
             <client url="tcp://localhost:8080/SimpleServer">
                <activated type="RemoteObjects.RemoteObject, RemoteObjects"/>
             </client>
             <channels>
                <channel ref="tcp client" >
                <!-- If you are using .NET 1.1 in conjunction with 
                  a leasing sponsor, you must uncomment the lines below
                  to add support for full serialization. -->
                
                <serverProviders> 
                  <formatter ref="binary" typeFilterLevel="Full" />
                </serverProviders>
              
             </channel>
             </channels>
          </application>
       </system.runtime.remoting>
    </configuration>
    总体做什么用,每部分做什么用,简要说明一下:)