473,382 Members | 1,447 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,382 software developers and data experts.

Windows service problem

Pakmarshal
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.ManagementEventWatcher” class to get event handlers for starting and stopping of processes. I used following code to set process arrived event

mManagementStartWatcher = New ManagementEventWatcher("Select * From Win32_ProcessStartTrace")
AddHandler mManagementStartWatcher.EventArrived, AddressOf ManagementWatcher_StartEventArrived
This works fine as whenever a process is launched in the computer it raises the event routine “ManagementWatcher_StartEventArrived”. Now the problem I am facing is, whenever I starts/stops my service multiple times it stops raising “ManagementWatcher_StartEventArrived” 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 ManagedInstallerClass.InstallHelper(ArgString)

Please guide me in this regard.

Thanks and Regards,

Maverick.
Sep 8 '10 #1
0 918

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

Similar topics

0
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...
0
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...
0
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...
3
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...
1
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....
2
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...
8
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...
6
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...
17
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.