By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,433 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,433 IT Pros & Developers. It's quick & easy.

Creating dll and windows services with VB Express 2005

P: n/a
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 application, DVD collection starter kit.
How can I do? Any suggest?
Thanks in advance.

VAL
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Create a Windows Application in the Visual Studio, then conver it to dll
file and use command-line compiler to build the assembly.

Gaidar

"Val3" <va****@NOSPAMcambieri.it> wrote in message
news:K6***********************@news4.tin.it...
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 application, DVD collection starter kit.
How can I do? Any suggest?
Thanks in advance.

VAL

Nov 21 '05 #2

P: n/a
That is a good question. VB Express is a very powerful tools at its limited feature set. With that said, I believe you can still do most things that is in the full featured parent
products it just does not have all the nice built in stuff that makes it really easy....

There are a couple of options....
1. You should be able to take an existing VS7/VS71 windows service project and open it up in the Express sku...migrate it to 2005 and their you go. Except you
probably do not have such a project :(
Or
2. You can create one from "scratch". First create a vb win app - remove the form.vb file and add a new class file - next add a .net reference to System.serviceprocess -
next change the class file code to look something like the below where you handle all methods required for the service.

You will have some additional things to work through but hopefully this will get you started in the write direction.

BTW, the default vb .net windows service project when built into an assembly - is an Exe and not a Dll.

Hope this helps.

Robert

------------------------------------------------------
Imports System.ServiceProcess

Public Class Service1
Inherits System.ServiceProcess.ServiceBase

#Region " Component Designer generated code "

Public Sub New()
MyBase.New()

' This call is required by the Component Designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call

End Sub

'UserService overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

' The main entry point for the process
<MTAThread()> _
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase

' More than one NT Service may run within the same process. To add
' another service to this process, change the following line to
' create a second service object. For example,
'
' ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService}
'
ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1}

System.ServiceProcess.ServiceBase.Run(ServicesToRu n)
End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

' NOTE: The following procedure is required by the Component Designer
' It can be modified using the Component Designer.
' Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Me.ServiceName = "Service1"
End Sub

#End Region

Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' 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

End Class
--------------------------------------------------------------------

Robert S (MSFT Visual Basic QA)
--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
From: "Val3" <va****@NOSPAMcambieri.it>
Newsgroups: microsoft.public.dotnet.languages.vb,microsoft.pub lic.dotnet.languages.vb.upgrade
Subject: Creating dll and windows services with VB Express 2005
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 0510-1, 11/03/2005), Outbound message
X-Antivirus-Status: Clean
Message-ID: <K6***********************@news4.tin.it>
Date: Sat, 12 Mar 2005 13:27:06 GMT
NNTP-Posting-Host: 80.180.145.35
X-Complaints-To: "Please send abuse reports to ab***@tin.it and technical notifications to ne********@tin.it"
X-Trace: news4.tin.it 1110634026 80.180.145.35 (Sat, 12 Mar 2005 14:27:06 MET)
NNTP-Posting-Date: Sat, 12 Mar 2005 14:27:06 MET
Organization: TIN
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!news- out.tin.it!news-in.tin.it!news4.tin.it.POSTED!not-for-mailXref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb.upgrade:7256 microsoft.public.dotnet.languages.vb:264782
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

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 application, DVD collection starter kit.
How can I do? Any suggest?
Thanks in advance.

VAL

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.