problem using class librarys


G

Guest

I was writing simple test program for using class libraries (OS: Windows 2003 Server). The problem I’ve got: runtime error:
-------------------------------------------
An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll
Additional information: Remoting configuration failed with the exception System.IO.FileNotFoundException: File or assembly name System.Runtime.Remoting, or one of its dependencies, was not found.
File name: "System.Runtime.Remoting".
------------------------------------------
Configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<System.Runtime.Remoting>
<application name="BasicRemotingClient">
<channels>
<channel
type="System.Runtime.Remoting.Channels.Http.HttpChannel,System.Runtime.Remoting" />
</channels>
</application>
</System.Runtime.Remoting>
</configuration>

Client: (BasicRemotingClient.cs)
using System;
using System.Runtime.Remoting;
using BasicServer;

namespace BasicClient
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class BasicRemotingClient
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Type type=typeof(BasicRemotingServer);
String url="http://localhost/BasicServiceDemo/BasicRemotingServer.soap";
RemotingConfiguration.Configure(@"D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\C#\BasicClient\BasicRemotingClient.exe.config");
BasicRemotingServer brs=(BasicRemotingServer)Activator.GetObject(type,url);
Console.WriteLine(brs.getServerResponse());
}
}
}

Server: (BasicRemotingServer.cs)
using System;

namespace BasicServer
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class BasicRemotingServer: MarshalByRefObject
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public string getServerResponse()
{
return "Greetings from the BasicRemotingServer component!";
}
}
}

The error occurs at Activator.GetObject(…) .

What is wrong and how to correct it?
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Using class libraries.. 2
Problem: Class Library 1
class library problem 3
Class libraries 2
Class Library 3
Class library 4
How to use class library when anthor class is used 2
using your own class library 4

Top