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

Help creating Windows Service .net studio 2005

I am having problems creating a Windows Service using Visual Studio

Code as follows:-
Imports System.IO
Imports System.Net.Mail
Public Class Service1
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set
' in motion so your service can do its work.
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop
your service.
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Dim test as new streamwriter("C:\test")
End Sub
Sub email()
Dim myMessage As New MailMessage("t...@test.com",
"tom.mil...@gmail.co.uk", _
"test", "test")
Dim mysmtpclient As New SmtpClient("exchange03")
End Sub
End Class
I have installed the service using the installutil
started the service using services manager in administritive tools
nothing happens.
i have tried doing various tasks within the timer tick procedure but
the service will not do anything. Am i missing something?? I know
code works as i have tested the code in a normal windows app. and
i am uninstalling the service, rebuilding the project then
the service.
This is frustrating!!!!
Any help is mich appreciated.
Cheers, Tom.

Sep 4 '07 #1
2 1756

<te******@gmail.comwrote in message
news:11**********************@r29g2000hsg.googlegr oups.com...

This is frustrating!!!!
Any help is mich appreciated.

I would suspect that the Service application has terminated along the way,
and you don't know it. I'll assume you are using try/catch/blocks on code in
critical areas like on the OnStart and Onstop and any other areas needed,
along with an Event log to capture error messages.

If you are using a NT based O/S like XP, then you can enable the Messenger
Service and use the Netsend command in the code to send messages to the
machine the Service is running on. The Netsend command will pop a message
box on the screen that you will have to reply to, but it can be used to send
messages to yourself as to just where you are at in the Service code that
can help you in your debugging process.

Sep 4 '07 #2
On 4 Sep, 18:33, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
<teeja...@gmail.comwrote in message

news:11**********************@r29g2000hsg.googlegr oups.com...

This is frustrating!!!!
Any help is mich appreciated.

My problem was that I was using the wrong timer. I was using the
System.Windows.Forms.Timer class rather than the System.Timers.Timer
Sep 5 '07 #3

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

Similar topics

by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices...
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...
by: scorpion53061 | last post by:
I have a request of Microsoft and I hope they see this. I use Visual Studio 2005 Pro and WIN XP Pro with IIS 5.1 I have spent the better part of the last 2 weeks attempting to get my ASP.NET...
by: Ryan | last post by:
I'm trying to create a report (similar to access) in VB 2005. It appears that Crystal Reports is the recommended method. I created a Crystal Report, set up the data connection (using the Wizard...
by: NathanC | last post by:
I am trying to create a simple service since and have never done this before. I have created a new project in VB.NET that is a Windows Service. (Just writing a single event entry to the log, just...
by: shapper | last post by:
Hello, In have a class inside a compiled DLL where I have the following code: ' Create site map XML document Dim siteMap As XmlDocument = New XmlDocument ' Load site map XML document from...
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
by: Dica | last post by:
we just ordered VS 2005 standard edition. i was reading up on creating windows services and apparently this is only possible with the enterprise edition. is this true, or does it simply mean...
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I'm puzzled by an error message encountered while creating a Windows Service. In particular, I'm creating a second Windows Service within a Windows Service project, using Visual Studio 2005. The...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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$) { } ...
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...
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...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.