我已经试过了普通的发布方式和使用IIS的发布方式,但Client端都不能够连接Server端。普通方式显示的信息是找不到发布的服务;而IIS方式是显示"不能正常连接,因为服务器正积极地拒绝它",但是我已经把它设定为Windows集成验证方式和允许匿名访问,并将匿名帐号赋予管理员权限了(ps:我是按照IIS的发布方式将生成为dll的remoting组件放在虚拟目录的bin文件夹里)。不知道是怎么回事?以下是我的config文件设定:
----- server ------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.runtime.remoting>
    <application>
      <service>
        <wellknown
          mode="Singleton"
          type="Server.QuestionBankService,QuestionBankService"
          objecturl="QuestionBankService.rem"
         />
    </service>
      <channels>
        <channel
           ref="http"
           port="80"
        />
      </channels>      
    </application>
  </system.runtime.remoting>
  <connectionStrings>
    <add name="QBDataBase" connectionString="workstation id=RICKYWORKS;packet size=4096;integrated security=SSPI;data source=RICKYWORKS\\SQLEXPRESS;persist security info=False;initial catalog=QBDataBase" providerName="System.Data.SqlClient"/>
  </connectionStrings>
</configuration>---- client ----
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.runtime.remoting>
    <application>
      <client>
        <wellknown
           type="Server.QuestionBankService,QuestionBankService"
           url="http://localhost:80/tryRemoting/QuestionBankService.rem"
            />
      </client>
      <channels>
        <channel
           ref="http"
           port="0"
            />
      </channels>
    </application>
  </system.runtime.remoting>  
</configuration>

解决方案 »

  1.   

    想起一个问题,部署Remoting是否需要强签名,并放到Assembly集里?
      

  2.   

    ----楼主----试用过其他端口比如8086都不行,用Http不是默认80端口吗?在IIS的默认网站那里也有显示的。防火墙已经关闭了
      

  3.   

    --- 楼主 ---有人说在IIS中必须用SingleCall模式,那我改用普通发布方式还是不行,路径已经改过了例如:
           <wellknown
               type="Server.QuestionBankService,QuestionBankService"
               url="http://localhost:80/QuestionBankService.rem"
                />
      

  4.   

    --- 楼主 ---突然想起是不是需要加入代码访问权限的认证呢?比如添加System.Security空间里的属性PS:我的类结构很简单,没有使用委托:public class ServerService : MarshalByRefObject
    {
        //Load config file and do something
    }public class RemoteClient
    {
       private ServerService service;   public RemoteClient()
          {
                //Load config file and initialize object
                service = new ServerService();  
          }
          //Do something that use ServerService 
    }
      

  5.   

    --- 楼主 ---用的是Win2000,没有防火墙。
    可能是Remoting存在访问权限的问题??但是MSDN里面没有这方面的说明...
      

  6.   

    ----- server ------
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.runtime.remoting>
        <application>
          <service>
            <wellknown
              mode="Singleton"
              type="Server.QuestionBankService,QuestionBankService"
              objecturl="QuestionBankService.rem"
             />
        </service>
          <channels>
            <channel
               ref="http"
               port="80"               ///这里我的写法是没有指定的 去掉看看///
            />
          </channels>      
        </application>
      </system.runtime.remoting>
      <connectionStrings>
        <add name="QBDataBase" connectionString="workstation id=RICKYWORKS;packet size=4096;integrated security=SSPI;data source=RICKYWORKS\\SQLEXPRESS;persist security info=False;initial catalog=QBDataBase" providerName="System.Data.SqlClient"/>
      </connectionStrings>
    </configuration>这些配置应该没问题的 就是不知道你的代码怎么写  帮你顶~~~
      

  7.   

    --- 楼主 ---我的类结构是这样子的,非常简单public class ServerService : MarshalByRefObject    //这是Server的组件
    {
        //do something
    }public class RemoteClient   //这是Client的接口。这里不需要继承MarshalByRefObject了吧?继承后也没用
    {
       private ServerService service;   public RemoteClient()
          {
                //Load config file and initialize object
                service = new ServerService();  
          }
          //Do something that use ServerService 
    }Server组件的运行方式是启动控制台应用程序,引用QuestionBankService.dll和读取Config file。