Problem in creating a Windows Service

G

Guest

I am creating a windows service which sends email to some people at regular intervals.

Shared Sub Main()
Dim ServicesToRun As System.ServiceProcess.ServiceBase
ServicesToRun = New System.ServiceProcess.ServiceBase(){New MailService()}
End Sub

In Timer Elapsed Event:
---------------------------------------------
Dim Mailmsg As New MailMessage()
With Mailmsg
.From = (e-mail address removed)
.To = (e-mail address removed)
.Subject = "Check Printer Status"
End With
SmtpMail.SmtpServer="127.0.0.1"
SmtpMail.Send(Mailmsg)
 
T

Thomas Dodds

Vinay: Citigroup.Com - "Thanks for visiting us at Careers at Citigroup! We are always looking for talented people to join our team ..."

Kavitha: you still having issues? I'll be glad to help you ... post your error
 
R

Rutger Smit

vinay said:
Hey Thomas

I created the service for email.
Now, how do i install it on the Server??

Do i need to copy the whole project to the server??

Thanks
vinay


:


unstallutil.exe does it, check out this page
http://www.aspnl.com/aspnl/nl/artikelen/windowsservice.asp (in Dutch, ha!)


Go to the VS.NET command prompt (Start > Programs > Microsoft Visual
Studio .NET > Visual Studio .NET Tools > Visual Studio .NET Command Prompt)

Typ on the commandline this statement: installutil
D:\Path\To\Executable\SchedulePlus.exe

Uninstalling: do the same but add the switch /u (but don't forget to
stop the service first)

//Rutger
 
R

Rutger Smit

vinay said:
Smit

I am able to run the service locally which i installed using installutil
command.

My Q is, now i have to implement the same on the Server.
To install on the server, do i have to move the whole project or just the
EXE file???

Thanks
vinay

:

The executable will be enough if you do not use custom libraries (dll's)
or other stuff.

//Rutger
 
R

Rutger Smit

vinay said:
I have one Dll added to the references Interop.aspSmartMail.dll

So do i have to move this dll too??

:


Yes you have to.

But if you are uncertain about it, why not try to run it on a testserver
first without the dll and see what happens. A good test by the way.

If you only made a refeence but you don't use it's functionality the you
don't have to upload it to the server. I guess you understand that?

//Rutger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top