Click here to Skip to main content
15,920,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: ShowDialog not displaying form. Pin
BillWoodruff14-Dec-11 22:03
professionalBillWoodruff14-Dec-11 22:03 
QuestionError 1067 C# windows service Pin
eyesark14-Dec-11 4:07
eyesark14-Dec-11 4:07 
I was doing a C# windows service. the service installs and runs well on my machine, but when i deploy on server (Windows server 2003), and try to start it, i get the dreaded 'Error 1067: application terminated unexpectedly'!
What to do?
some of the code is shown below:

i was doing a C# windows service. the service installs and runs well on my machine, but when i deploy on server (Windows server 2003), and try to start it, i get the dreaded 'Error 1067: application terminated unexpectedly'!
What to do?
some of the code is shown below:

C#
[RunInstaller(true)]
public partial class MessagingInstaller : Installer
{
    public MessagingInstaller()
    {
        InitializeComponent();
    }
}

public partial class MessagingService : ServiceBase
{
    //declare the message sending logic
    private MessagingLogic msglgc;
    //private readonly EventLog _log = new EventLog { Source = "MessageLogger" };

    public MessagingService()
    {
        InitializeComponent();
    }

    //create new instance of the message sending logic and/or start service
    protected override void OnStart(string[] args)
    {
        if (!EventLog.SourceExists("MessageLogger"))
            EventLog.CreateEventSource("MessageLogger", "Event Logger");

        var _log = new EventLog { Source = "MessageLogger" };

        try
        {
            if (msglgc == null)
                msglgc = new MessagingLogic();

            msglgc.Start();
        }
        catch (ArgumentException exception)
        { _log.WriteEntry("OnStart Error: " + exception.Message); }
    }

    //stop the service
    protected override void OnStop()
    {
        if (!EventLog.SourceExists("MessageLogger"))
            EventLog.CreateEventSource("MessageLogger", "Event Logger");

        var _log = new EventLog { Source = "MessageLogger" };

        try
        {
            if (msglgc != null)
                msglgc.Stop();
        }
        catch (ThreadAbortException exception)
        { _log.WriteEntry("OnStop Error: " + exception.Message); }
    }
}




Please help! I need the solution as soon as possible

modified 14-Dec-11 11:00am.

AnswerRe: Error 1067 C# windows service Pin
PIEBALDconsult14-Dec-11 4:34
mvePIEBALDconsult14-Dec-11 4:34 
AnswerRe: Error 1067 C# windows service Pin
Richard MacCutchan14-Dec-11 5:58
mveRichard MacCutchan14-Dec-11 5:58 
AnswerRe: Error 1067 C# windows service Pin
jschell14-Dec-11 9:18
jschell14-Dec-11 9:18 
AnswerRe: Error 1067 C# windows service Pin
Pete O'Hanlon14-Dec-11 11:22
mvePete O'Hanlon14-Dec-11 11:22 
QuestionRun the application once Pin
sarang_k14-Dec-11 3:07
sarang_k14-Dec-11 3:07 
AnswerRe: Run the application once Pin
Wayne Gaylard14-Dec-11 3:26
professionalWayne Gaylard14-Dec-11 3:26 
GeneralRe: Run the application once Pin
BobJanova14-Dec-11 3:43
BobJanova14-Dec-11 3:43 
GeneralRe: Run the application once Pin
Wayne Gaylard14-Dec-11 3:52
professionalWayne Gaylard14-Dec-11 3:52 
AnswerRe: Run the application once Pin
thatraja14-Dec-11 4:23
professionalthatraja14-Dec-11 4:23 
AnswerRe: Run the application once Pin
Luc Pattyn14-Dec-11 9:26
sitebuilderLuc Pattyn14-Dec-11 9:26 
GeneralRe: Run the application once Pin
BillWoodruff14-Dec-11 22:13
professionalBillWoodruff14-Dec-11 22:13 
GeneralRe: Run the application once Pin
Pete O'Hanlon14-Dec-11 22:15
mvePete O'Hanlon14-Dec-11 22:15 
AnswerRe: Run the application once Pin
BillWoodruff14-Dec-11 22:13
professionalBillWoodruff14-Dec-11 22:13 
QuestionUse the environment provided by the application instead from system environment. Pin
Member 848801414-Dec-11 1:35
Member 848801414-Dec-11 1:35 
AnswerRe: Use the environment provided by the application instead from system environment. Pin
PIEBALDconsult14-Dec-11 1:45
mvePIEBALDconsult14-Dec-11 1:45 
SuggestionRe: Use the environment provided by the application instead from system environment. Pin
Shameel14-Dec-11 2:02
professionalShameel14-Dec-11 2:02 
QuestionDisplay a menu in context menu Pin
sarang_k14-Dec-11 0:00
sarang_k14-Dec-11 0:00 
AnswerRe: Display a menu in context menu Pin
BillWoodruff14-Dec-11 2:48
professionalBillWoodruff14-Dec-11 2:48 
QuestionHow I can Show the Value of Textbox in another form in C sharp? Pin
ishaq shinwari13-Dec-11 21:25
ishaq shinwari13-Dec-11 21:25 
AnswerRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Pete O'Hanlon13-Dec-11 21:37
mvePete O'Hanlon13-Dec-11 21:37 
GeneralRe: How I can Show the Value of Textbox in another form in C sharp? Pin
ishaq shinwari13-Dec-11 22:26
ishaq shinwari13-Dec-11 22:26 
GeneralRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Pete O'Hanlon13-Dec-11 23:01
mvePete O'Hanlon13-Dec-11 23:01 
AnswerRe: How I can Show the Value of Textbox in another form in C sharp? Pin
Varun Sareen13-Dec-11 23:12
Varun Sareen13-Dec-11 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.