C# IpcChannel MSDN示例:无法加载类型{0}异常
我遵循了IpcChannel类的MSDN示例: 我做了两个控制台应用程序项目: 客户:C# IpcChannel MSDN示例:无法加载类型{0}异常,c#,ipc,C#,Ipc,我遵循了IpcChannel类的MSDN示例: 我做了两个控制台应用程序项目: 客户: namespace IPC_Client_Test { class Program { [SecurityPermission(SecurityAction.Demand)] public static void Main(string[] args) { // Create the channel.
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
我运行服务器,然后启动客户机,并在这一行获得一个exeption:
Console.WriteLine("The remote object has been called {0} times.", service.GetCount());
无法加载类型“IPC\u Client\u Test.RemoteObject,IPC Client Test,Version=1.0.0,Culture=neutral,PublicKeyToken=null”。当我开始使用IPC时,我在网上搜索并找到了来自TechRepublic的Zach Smith的一些示例。我想你可以从这个开始。它帮助我做了一个基本的IPC
谢谢,样品解释得更好了,现在我可以看出我的错误了。共享对象应位于单独的项目/解决方案中。