IpcChannel MSDN示例:无法加载类型{0}异常

时间:2011-08-30 16:03:33

标签: c# ipc

我按照IpcChannel类的MSDN示例: http://msdn.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcchannel.aspx

我制作了两个控制台应用程序项目:

客户:

namespace IPC_Client_Test
{
    class Program
    {
        [SecurityPermission(SecurityAction.Demand)]
        public static void Main(string[] args)
        {
            // Create the channel.
            IpcChannel channel = new IpcChannel();
            // Client code

服务器:

namespace IPC_Server_Test
{
    class Program
    {
        [SecurityPermission(SecurityAction.Demand)]
        public static void Main(string[] args)
        {
            // Create the server channel.
            IpcChannel serverChannel =new IpcChannel("localhost:9090");
            // Server Code

我运行服务器然后启动客户端,我在这一行获得了一个例外:

Console.WriteLine("The remote object has been called {0} times.", service.GetCount());

无法加载类型'IPC_Client_Test.RemoteObject,IPC Client Test,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null'。

1 个答案:

答案 0 :(得分:0)

当我开始使用IPC时,我在网上搜索并找到了来自TechRepublic的Zach Smith的一些例子。我想你可以从这开始。它帮助我建立了一个基本的IPC。

http://www.techrepublic.com/article/using-ipc-channels-and-net-framework-20-to-communicate-between-processes/6143016

相关问题