473,664 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows service problem

Pakmarshal
17 New Member
I am working on a Windows Service application in VB.net 2008. The main objective of the application is to monitor starting and stopping of applications listed in a file. I build the service as system level by using ‘System’ user account. I used “Management.Man agementEventWat cher” class to get event handlers for starting and stopping of processes. I used following code to set process arrived event

mManagementStar tWatcher = New ManagementEvent Watcher("Select * From Win32_ProcessSt artTrace")
AddHandler mManagementStar tWatcher.EventA rrived, AddressOf ManagementWatch er_StartEventAr rived
This works fine as whenever a process is launched in the computer it raises the event routine “ManagementWatc her_StartEventA rrived”. Now the problem I am facing is, whenever I starts/stops my service multiple times it stops raising “ManagementWatc her_StartEventA rrived” event. It remain as it is even if I restart my service and also start it after unistalling and installing (using sc.exe and installutil). This starts working only when I restarts my computer.

My service executeable handles ‘-i/-u’ arguments to self install/uninstall. I used following code to install/uninstall

Dim ArgString As String()

' Set arguments to install/uninstall service

If InstallSrv Then
ArgString = New String() {"/LogFile=", SrvExePath}
Else
ArgString = New String() {"/u", "/LogFile=", SrvExePath}
End If

' Install/uninstall service

Call ManagedInstalle rClass.InstallH elper(ArgString )

Please guide me in this regard.

Thanks and Regards,

Maverick.
Sep 8 '10 #1
0 931

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1145
by: John Rebocho | last post by:
I made a service in Studio .NET 2003 for windows. The problem is when the service is installed on a PC with Studio .NET 2003 installed on it, the service runs all the .exe's it is coded to, but when I install the service on a PC with out Studio .NET 2003 it does not run the .exe's in the code. All the PC's have .NET Framework 1.1 installed on them. Here is another stumper I have Studio .NET 2003 installed on my PC where I am developing...
0
2025
by: W Akthar | last post by:
Hi All, I have created a simple Windows Service which needs to be able to send appointments to Outlook. I have no problem makeing a reference to Microsoft Outlook 11.0 Object Library and compiling the code. the problem arises when I try to install the service using installutil. The error message I get is the following
0
1296
by: Miguel Hernandez | last post by:
H I've experienced problems running the following code in a windows service. Notice that in a windows application it works just fine as spected Private TextoUSD As Strin Friend WithEvents WebUSD As New SHDocVw.InternetExplorer( Private Sub WebUSD_DocumentComplete(ByVal pDisp As Object, ByRef URL As Object) Handles WebUSD.NavigateComplete2, WebUSD.DocumentComplet LoggearError("WebUSD_DocumentComplete", -1, "Bien! ahora a insertar los...
3
1451
by: alegon | last post by:
Hi... I´m making an instaler for the windows service I've recently develop, my sevice needs a few config files to be located on the same path of the executable file of the service, when I install the service in a folder I put all the config files on this folder but the problem is that when the service starts it cannot load that files because the System.Environment.CurrentDirectory property points to windows\system32 and not to the...
1
1271
by: Remy De Almeida | last post by:
Hi , Sorry i am posting this again as no one seems have taken notice of this in the distributed appln forum I have a remote server which works fine. The Client ans server work with no problem. However when i convert the server to a windows service i run into problems. The service installs fine and starts fine too. It also seems to register the channels and create the well know types.
2
1518
by: vsciw | last post by:
Hi. I think this is the correct group to post this in. apologies if not. we had a VS2003 built windows service installed and running on both a 32-bit and 64-bit server ok (vb.net). we had to upgrade the service to VS2005, and this is running fine on the 32-bit server but on the 64- bit server we are gettting an error "cannot create the activex component".
8
5778
by: DF Dev | last post by:
I have created a Windows Service using Visual Studio .Net 2005 and C# which executes a series of database jobs on a time basis. I am using SqlConnections and SqlCommand objects to connect to a SQL Server database and execute stored procedures and query text commands. I am running into this problem on some computers after a reboot is done. I get the following error message when the service attempts to execute a SqlCommand: Could not...
6
239
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, I've created a windows application C# service according to: http://msdn2.microsoft.com/en-us/library/ms123402.aspx?wa=wsignin1.0 But my service is not appearing in the computer management panel at all. Any ideas ? cheers
17
3204
by: ayush patel | last post by:
Hi all, I have created a windows service that has a file watcher and does some operation after it reads that file. i developed it in my local machine and installed the service on server. i have changed the file path and everythng according to server drives. we all in the office share some network drives in which ppl will keep pasting that file and the service on server has to pick it up. which its not doing. when i paste it in netwrok...
0
8437
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7375
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4185
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.