how windows service finds another .Net component

G

Guest

I am new to .Net.
I have a Windows service in C#. It is going to use another .Net component
(DLL) made by a 3rd party company. If I start my program as an app with that
DLL in the same directory, my program can use it. But if I start it as a
service, it does not work. How does a .Net windows service finds other DLL?
From "path"?
 
M

mdb

I am new to .Net.
I have a Windows service in C#. It is going to use another .Net
component (DLL) made by a 3rd party company. If I start my program as
an app with that DLL in the same directory, my program can use it. But
if I start it as a service, it does not work. How does a .Net windows
service finds other DLL? From "path"?

I suspect your problem isn't the app finding the DLL, but rather that
applications can't be started as services (at least not without a bit of
tricky code). What is the exact error message that you are receiving?

-mdb
 
G

Guest

The service can be started and running.
I can write out a text file in my code.

The 3rd party .Net component I refer to indeed is Apache log4Net.
No log file is created from it, so I don't know whether the service can find
the log4net.dll. Should the log4net.dll be copied into C:\windows\system32 ?
My own text file is found in C:\windows\system32 so the "current" directory
must be "C:\windows\system32".

Does a .Net windows service require a manifest file?
 
N

Nick Malik [Microsoft]

You usually have to place the called DLL into the GAC, which means that it
must be strongly named.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

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

Top