tags:

views:

446

answers:

4

Hi, I have a DLL and i want to know whether it is possible to run the DLL as service.Is there any way to do it ?

i am using .net 2.0.

Thanks in advance.

+3  A: 

I dont think you simple use a DLL as a service directly, but what you can do is create a bridge service, i.e. a web service, WCF or a remotable object, which takes this DLL as a reference and exposes its public methods as a service.

Bhaskar
sorry i am having only .net 2.0
Jebli
thats fine, in that case simple make a Web Service
Bhaskar
the problem is i wm not having the code but i have the DLL.so how to make the dll as a web service.Do you mean adding the reference the web service project and creating a layer for it aslling all the methods in the DLL ?
Jebli
Create a Web Service project in VS 2005 (.net 2.0). Just add the DLL as a reference to your project. Use the name space to find out all the classes it has (you can find details about the DLL objects from the proxy class created). Then instantiate the objects and start using its public methods.
Bhaskar
Yes i can understand what you are saying.but in this way we need lots of coding effort for calling each and every public method.SO i am looking for options where we can just use the DLL as the service and to consume the public methods directly.
Jebli
I don't think you can simply pick up your DLL and expose it as a service, without making it as a "service"
Bhaskar
can't it be dont through remoting ? Can we user the same dll by multiple applications using remoting ?
Jebli
+1  A: 

You can create a WCF Service which references your DLL. Create a service and data contract and create a Service Host. See here for the microsoft site for it.

Russell
I am not having frameork 3.5 . i am using .net 2.0.
Jebli
Yep, like Bhaskardeep said, you can make a Web Service using .net 2.0.
Russell
+2  A: 

Wrap it in a windows service? Fairly trivial.

Noon Silk
window service is not a way to expose your app/objects as a service. Windows service is an application which runs locally in the background (go to Control Panel > Administrative Tasks > Services)
Bhaskar
@Bhaskardeep Khaund, then again he hasn't replied to the questions of what he mean by service, so silkys answer can still be valid.
Arkain
+1  A: 

Consider COM+ / Enterprise Services. It will allow you to run your DLL in a service with .Net 2.0.

codekaizen
can u suggest me any link where we can understand how to do it ?
Jebli
This looks like a good set of articles: http://support.microsoft.com/kb/308672
codekaizen