473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1418
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.