473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how windows service finds another .Net component

BBM
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"?
Nov 22 '05 #1
6 1416
mdb
=?Utf-8?B?QkJN?= <BB*@discussions.microsoft.com> wrote in
news:BA**********************************@microsof t.com:
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
Nov 22 '05 #2
mdb
=?Utf-8?B?QkJN?= <BB*@discussions.microsoft.com> wrote in
news:BA**********************************@microsof t.com:
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
Nov 22 '05 #3
BBM
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?
"mdb" wrote:
=?Utf-8?B?QkJN?= <BB*@discussions.microsoft.com> wrote in
news:BA**********************************@microsof t.com:
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

Nov 22 '05 #4
BBM
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?
"mdb" wrote:
=?Utf-8?B?QkJN?= <BB*@discussions.microsoft.com> wrote in
news:BA**********************************@microsof t.com:
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

Nov 22 '05 #5
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.
--
"BBM" <BB*@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
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"?

Nov 22 '05 #6
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.
--
"BBM" <BB*@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
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"?

Nov 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: BBM | last post by:
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,...
0
by: Eric | last post by:
I have a Windows service that I created that simply exposes a single public function (RemoteCall). How can I access this publicly exposed method of a windows service from a windows application?...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
0
by: Seth | last post by:
For some reason my service works fine except that it will create the file in my c drive, but will not write to the file. Sorry if this is a duplicate post, i have found some that ask the same...
5
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason...
2
by: Val3 | last post by:
Hi all. I need to build dll(s) and windows services using VB .NET 2005 Express. When I make File/New project the windows contain only Windows application, Windows control library, Console...
2
by: Mr Newbie | last post by:
I have an annoying teenager who wont go to bed because he is allways on his computer. I want to write a windows service which will shut down his computer at night and not allow this to be...
28
by: | last post by:
I have a multi threaded windows form application that runs great after calling Application.Run(). Application.Run is required for a COM component I a using in the app (required for message loop). ...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.