zoukankan      html  css  js  c++  java
  • Building a Basic .NET Remoting Application 之四 Compiling and Running the Basic Application

    Compiling and Running the Basic Application

    To use the command-line tools that ship with the .NET Framework SDK to compile the basic remoting application built in the topics Building a Remotable Type, Building a Host Application, and Building a Client Application, save all files in a directory called Listener, using the names specified in those topics. At the command prompt in the Listener directory, type the following commands:

    [C#]

    csc /noconfig /t:library RemotableType.cs

    csc /noconfig /r:RemotableType.dll Listener.cs

    csc /noconfig /r:RemotableType.dll Client.cs

    To run the application

    1. Create a subdirectory called Client.
    2. Copy the RemotableType.dll, Client.exe, and Client.exe.config files to the Client directory.
    3. At the command prompt in the Listener directory, type:

      Listener

    4. When the Listener application is running, open a new command prompt in the Client directory and type:

      Client

    Changing the Channel

    Because the Listener.exe.config and Client.exe.config files contain all the configuration information necessary to make a remote connection, you can change the channel without recompiling your application merely by changing the channel specified in the configuration file.

    To change the channel to a TcpChannel object, which uses binary serialization by default, you merely change the <wellknown> element in the Client.exe.config file to the following:

    <wellknown
       type="RemotableType, RemotableType"
       url="tcp://localhost:8989/RemotableType.rem"
    />

    You must also change the <channel> element in the Listener.exe.config file to the following:

    <channel ref="tcp" port="8989"/>

    Rerun the application according to the preceding execution instructions. You do not need to recompile the application.

  • 相关阅读:
    sersync实时同步实战+nfs共享存储
    ssh协议详解
    nfs共享存储+实时同步(结合rsync+inotify)
    sqlserver 个人整理
    vba 自定义菜单与vba通过sql查询
    c# 自定义排序Compare
    c# delegate知识
    mvc Dapper_Report_Down_ExcelFile
    c# bootstrap-table 知识
    c# Stream to File的知识点
  • 原文地址:https://www.cnblogs.com/MayGarden/p/1639011.html
Copyright © 2011-2022 走看看