IpcChannel MSDN 示例:无法加载类型 {0} 异常
我按照 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客户端测试,版本= 1.0.0.0,文化=中性,PublicKeyToken = null”。
I followed the MSDN example for the IpcChannel class :
http://msdn.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcchannel.aspx
I made two Console Application Projects :
The client :
namespace IPC_Client_Test
{
class Program
{
[SecurityPermission(SecurityAction.Demand)]
public static void Main(string[] args)
{
// Create the channel.
IpcChannel channel = new IpcChannel();
// Client code
And the server :
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
I run the Server then launch the Client and I get an exeption at this line :
Console.WriteLine("The remote object has been called {0} times.", service.GetCount());
Cannot load type 'IPC_Client_Test.RemoteObject, IPC Client Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我开始使用 IPC 时,我在网络上搜索并找到了来自 TechRepublic 的 Zach Smith 的一些示例。我想你可以从这个开始。它帮助我制作了一个基本的IPC。
http:// /www.techrepublic.com/article/using-ipc-channels-and-net-framework-20-to-communicate- Between-processes/6143016
When I started using IPC, I've search over the web and found some examples by Zach Smith, from TechRepublic. I think you could start by this. It helped me to make a basic IPC.
http://www.techrepublic.com/article/using-ipc-channels-and-net-framework-20-to-communicate-between-processes/6143016