VB Class

  • Thread starter Thread starter André Almeida Maldonado
  • Start date Start date
A

André Almeida Maldonado

Hy Guys.. I'm Trying to write a class (clasliga.vb), but I'M receiving this
message from compiler:

vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'

Please tell me what is wrong...

This is my code:

Public Class Ligacoes

Private sLigaAten as String
Private sLigaDest as String
Private sLigaReme as String
Private sLigaTele as String
Private sLigaAssu as String

Property LigaAten() As String
Get
Return sLigaAten
End Get
Set(ByVal sNome As String)
sLigaAten = sNome
End Set
End Property

Property LigaDest() As String
Get
Return sLigaDest
End Get
Set(ByVal sNome As String)
sLigaDest = sNome
End Set
End Property

Property LigaReme() As String
Get
Return sLigaReme
End Get
Set(ByVal sNome As String)
sLigaReme = sNome
End Set
End Property

Property LigaTele() As String
Get
Return sLigaTele
End Get
Set(ByVal sNome As String)
sLigaTele = sNome
End Set
End Property

Property LigaAssu() As String
Get
Return sLigaAssu
End Get
Set(ByVal sNome As String)
sLigaAssu = sNome
End Set
End Property

End Class
 
André Almeida Maldonado said:
Hy Guys.. I'm Trying to write a class (clasliga.vb), but I'M
receiving this message from compiler:

vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'

Please tell me what is wrong...

This is my code:
[Class without Sub Main]

Seems like you don't have a Sub Main....

What is the first procedure that should be executed when your application
starts? You must have a Sub Main somewhere. In the project properties, you
can specify the startup object, i.e. where your Sub Main is located. You can
also specify a Form object there because an invisible Sub Main will be
added.
 
* "André Almeida Maldonado said:
vbc: error BC30420: 'Sub Main' was not found in 'ClasLiga'

Do you want to compile a class library with "vbc.exe"? Don't forger to
specify "/target:library" in the command calling the compiler.
 
* (e-mail address removed) (Herfried K. Wagner [MVP]) scripsit:
Do you want to compile a class library with "vbc.exe"? Don't forger to
specify "/target:library" in the command calling the compiler.

I forgot to mention: If you want to compile an executable, it needs an
entry point, the 'Sub Main'.

\\\
Public Class ...
Public Shared Sub Main()

' Add the application code here.
End Sub
 
Back
Top