using Dlls present in remote machine

G

Guest

I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).
 
N

Nicholas Paldino [.NET/C# MVP]

Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call somehow
in a technology that will allow the remote call.

Hope this helps.
 
G

Guest

Nicholas,

I need to run that dll in the remote machine and in my local C# application
i need to use those methods in dll.. If you have samples or articles where i
could get more information regarding this kindly let me know.
Thanks
Nicholas Paldino said:
Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call somehow
in a technology that will allow the remote call.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rohith said:
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).
 
N

Nicholas Paldino [.NET/C# MVP]

Rohith,

When you say you need to run them local in your C# application, I assume
you mean that you need to initialize the call from your C# application, but
have it execute on the remote machine.

In this case, look up "Remoting" in the .NET documentation. There
should be a tutorial there on how to create a remoting server and client
proxy.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rohith said:
Nicholas,

I need to run that dll in the remote machine and in my local C#
application
i need to use those methods in dll.. If you have samples or articles where
i
could get more information regarding this kindly let me know.
Thanks
Nicholas Paldino said:
Rohith,

Do you need the dll to run on the remote machine or do you need it to
run on the local machine?

If you need it to run on the local machine, then you should just
distribute it with your application and call it through the P/Invoke
layer.

If you need it to run on the remote machine, then you have a few
options. The first would be to create a component derived from
ServicedComponent that will act as a server in COM+, and then make the
remote call from the client machine. The COM+ component would then make
the
call to the dll on the remote machine.

You can also use remoting to do this as well, or expose a web service
from the remote machine. In the end, you will have to wrap the call
somehow
in a technology that will allow the remote call.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rohith said:
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not
a
webservice. I need something like remote method invocation(but dlls).
 
W

Willy Denoyette [MVP]

Rohith said:
I need to import dlls that are present in the remote machine. Its a dll
written in C that exposes methods. I want to import that dll in my C#
application. But that dll is not present in the local machine. Its not a
webservice. I need something like remote method invocation(but dlls).

If the DLL is a native C++ code DLL, there is no way to do call any method
directly from C#.
But, you say it's a C dll that exposes 'methods', well a C dll doesn't
expose methods, it can at best export functions. Now these functions can be
called through PInvoke but only when the DLL is local. If you really need
this to be remoted, you will have to create a C# wrapper for your DLL and
use .NET remoting to call it from a C# remoting client. Another option is
wrap the DLL in a C# DLL using System.EnterpriseServices and drop this DLL
in a servertype COM+ application, export a proxy from this server
application and use this proxy at the client to call the server from a C#
client.

Willy.
 

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


Top