Advertisement

07.17.2008 at 05:53AM PDT, ID: 23572951
[x]
Attachment Details

VB.NET Service not starting on Windows XP && Windows 2003 Server

Asked by carlosperezhuelva in .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio

Hello Experts,

Our company has a VB.NET software that runs as a service. The software runs successful every installation, but we have a customer who has installed in two differents computers with the same problem: the service refuses to start.

If we take a look at the Windows Event Viewer, the application leaves the following message:

No se puede iniciar el servicio: System.Exception: Licencia inválida
 en GPRS_TUNER.GPRSTuner.OnStart(String[] args)
 en System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

It's in spanish, but it says something like: "Could not start the service: System.Exception: Invalid License"

It's treated as an error and with ID = 0

It's the first time we have this problem, all the software installed before worked fine.

The two problematic computers are:
- Windows XP Professional
- Windows 2003 Server
The customer says he has original Windows licenses.

.NET Framework 3.5 is installed on the two machines.
Latest Windows SP are installed too.
He has no antivirus or firewall software.

We don't have any exception that could give this message, our software does not validate any license...

Our software is using some 3rd party libraries, like Bytefx.mysql.client, someone told me to migrate to mysql .net connector, but before this change is made, we need to solve this problem.

Remember, this software with no changes is running successful in a lot of computers, and only one customer is reporting issues...

Any help will be appreciated. Thanks.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
'DATA       AUTOR       ID      MODIFICACIO
'05/12/2007 EBD        ++0001  Implementació d'un control per a DataTuner
'08/02/2008 EBD        ++0002  Se cambian los tiempos de comprobación
 
Imports System.IO
'Imports System.Runtime.Serialization
''Imports ByteFX.Data.MySqlClient
Imports System.ServiceProcess
'Imports System
Imports System.Threading
'Sólo importado para pruebas, después eliminar.
'Imports System.Windows.Forms
 
 
Public Class GPRSTuner
    Inherits System.ServiceProcess.ServiceBase
    'Añadimos las variables para el control de memoria de DataTuner.
    Private Shared timerID As System.Threading.Timer
    Public Const MAXSIZE As Int64 = 100000000
 
#Region " Código generado por el Diseñador de componentes "
 
    Public Sub New()
        MyBase.New()
 
        ' El Diseñador de componentes requiere esta llamada.
        InitializeComponent()
 
        ' Agregar cualquier inicialización después de la llamada a InitializeComponent()
        Me.CanPauseAndContinue = False
        Me.CanStop = True
        Me.AutoLog = True
    End Sub
 
    'UserService reemplaza a Dispose para limpiar la lista de componentes.
    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
 
    ' El punto de entrada principal para el proceso
    <MTAThread()> _
    Shared Sub Main()
        Dim ServicesToRun() As System.ServiceProcess.ServiceBase
 
        ' Se puede ejecutar en el mismo proceso más de un servicio NT. Para agregar
        ' otro servicio a este proceso, cambie la siguiente línea a fin de
        ' crear otro objeto de servicio. Por ejemplo,
        '
        '   ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService}
        '
        ServicesToRun = New System.ServiceProcess.ServiceBase() {New GPRSTuner}
 
        System.ServiceProcess.ServiceBase.Run(ServicesToRun)
    End Sub
 
    'Requerido por el Diseñador de componentes
    Private components As System.ComponentModel.IContainer
 
    'NOTA: el Diseñador de componentes requiere el siguiente procedimiento
    'Se puede modificar utilizando el Diseñador de componentes. No lo modifique
    ' con el editor de código.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        '
        'GPRSTuner
        '
        Me.ServiceName = "GPRSTuner"
 
    End Sub
 
#End Region
    Private Esdato As EstadoGPRS
    'Private Configuracion As ConfiguracionGPRS
    Dim config As ConfiguracionGPRS = Nothing
    Private Activacion As ActivacionCL
    Protected Overrides Sub OnStart(ByVal args() As String)
        ' Agregar código aquí para iniciar el servicio. Este método debería poner en movimiento
        ' los elementos para que el servicio pueda funcionar.
 
        If args.Length = 1 Then
            Try
                config = New ConfiguracionGPRS
                config.parse(args(0))
                If config.IP_Local = "" Then Throw New Exception
            Catch ex As Exception
                config = Nothing
            End Try
        End If
        Controlador.getInstance.iniciar(config, False)
 
        timerID = New System.Threading.Timer(New Threading.TimerCallback(AddressOf Verifica), Nothing, 1800000, 1800000)
 
    End Sub
 
Loading Advertisement...
 
[+][-]07.17.2008 at 06:53AM PDT, ID: 22025439

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 09:42AM PDT, ID: 22027290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 09:46AM PDT, ID: 22027335

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 09:54AM PDT, ID: 22027418

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 10:58AM PDT, ID: 22028128

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 01:31PM PDT, ID: 22029930

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 02:13PM PDT, ID: 22030405

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Visual Basic.Net, Visual Studio
Sign Up Now!
Solution Provided By: cpkilekofp
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906