Click here to Skip to main content
15,917,176 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: gridview dropdownlist bind onclick Pin
Ali Al Omairi(Abu AlHassan)26-Feb-11 4:55
professionalAli Al Omairi(Abu AlHassan)26-Feb-11 4:55 
QuestionError in installing Windows Service [modified] Pin
indian14324-Feb-11 11:14
indian14324-Feb-11 11:14 
Hi All,

I have a windows service, which integrates with ASP.Net application, when I am trying to install the service using following command
"installutil /account=LocalSystem /user=xxxxx /password=xxxxxatgmail StatusMessageService.exe" its giving following error. I am unable to find the reason for this any help would be appreciate.

"An exception occurred during the Install phase.
System.InvalidOperationException: Cannot open Service Control Manager on computer '.'. This operation might require other privileges.
The inner exception System.ComponentModel.Win32Exception was thrown with the following error message: Access is denied."

My aacount credentials are correct still why is it giving this exception. Can anybody please help me in this, its little urgent. I am trying my best to do ti as well but, one shot from the other side also. Please help me, thanks.

My Service is written as below which was working before and was writing in to the file, but now when I am trying to install again its throwing exception above.

protected override void OnStart(string[] args)
{
    AddToFile("Starting Service :: Time : " + DateTime.Now.ToString());
    //ad 1: handle Elapsed event
    timer.Elapsed += new ElapsedEventHandler(OnElapsedTime);

    //ad 2: set interval to 1 minute (= 60,000 milliseconds)
    timer.Interval = 1000;

    //ad 3: enabling the timer
    timer.Enabled = true;
}

protected override void OnStop()
{
    timer.Enabled = false;
    AddToFile("Stopping Service");
}

private void OnElapsedTime(object source, ElapsedEventArgs e)
{
    AddToFile(" Another entry");
}


private void AddToFile(string contents)
{
    //set up a filestream
    FileStream fs = new
        FileStream(@"D:\Test\timerserv.txt", FileMode.OpenOrCreate, FileAccess.Write); //StatusMessageService\

    //set up a streamwriter for adding text
    StreamWriter sw = new StreamWriter(fs);

    //find the end of the underlying filestream
    sw.BaseStream.Seek(0, SeekOrigin.End);

    //add the text
    sw.WriteLine(contents);
    //add the text to the underlying filestream

    sw.Flush();
    //close the writer
    sw.Close();
}



In the log file it is giving me the following exception


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the D:\StatusMessageService\StatusMessageService\bin\Debug\StatusMessageService.exe assembly's progress.
The file is located at D:\StatusMessageService\StatusMessageService\bin\Debug\StatusMessageService.InstallLog.

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

The Rollback phase of the installation is beginning.
See the contents of the log file for the D:\StatusMessageService\StatusMessageService\bin\Debug\StatusMessageService.exe assembly's progress.
The file is located at D:\StatusMessageService\StatusMessageService\bin\Debug\StatusMessageService.InstallLog.

The Rollback phase completed successfully.

The transacted install has completed.
Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA
modified on Thursday, February 24, 2011 6:50 PM

AnswerRe: Error in installing Windows Service Pin
N a v a n e e t h24-Feb-11 16:57
N a v a n e e t h24-Feb-11 16:57 
GeneralRe: Error in installing Windows Service Pin
indian14325-Feb-11 6:50
indian14325-Feb-11 6:50 
GeneralRe: Error in installing Windows Service Pin
N a v a n e e t h26-Feb-11 14:28
N a v a n e e t h26-Feb-11 14:28 
QuestionGet Username for logged in user Pin
dataminers24-Feb-11 6:22
dataminers24-Feb-11 6:22 
AnswerRe: Get Username for logged in user Pin
mcmathys0424-Feb-11 10:20
mcmathys0424-Feb-11 10:20 
GeneralRe: Get Username for logged in user Pin
GenJerDan24-Feb-11 11:07
GenJerDan24-Feb-11 11:07 
QuestionTree View Control Pin
JustWorking24-Feb-11 3:28
JustWorking24-Feb-11 3:28 
AnswerRe: Tree View Control Pin
Geoff Williams24-Feb-11 6:50
Geoff Williams24-Feb-11 6:50 
AnswerRe: Tree View Control Pin
Ali Al Omairi(Abu AlHassan)26-Feb-11 4:07
professionalAli Al Omairi(Abu AlHassan)26-Feb-11 4:07 
Questionrequired source code of Online admission sytem in asp.net Pin
sunny mehra23-Feb-11 16:23
sunny mehra23-Feb-11 16:23 
AnswerRe: required source code of Online admission sytem in asp.net Pin
Anurag Gandhi23-Feb-11 19:59
professionalAnurag Gandhi23-Feb-11 19:59 
AnswerRe: required source code of Online admission sytem in asp.net Pin
R. Giskard Reventlov23-Feb-11 21:56
R. Giskard Reventlov23-Feb-11 21:56 
AnswerRe: required source code of Online admission sytem in asp.net Pin
Ravi Sant23-Feb-11 23:38
Ravi Sant23-Feb-11 23:38 
AnswerRe: required source code of Online admission sytem in asp.net Pin
Keith Barrow24-Feb-11 0:24
professionalKeith Barrow24-Feb-11 0:24 
QuestionAJAX Calender and SQL Server Pin
SarfarajAhmed23-Feb-11 13:48
SarfarajAhmed23-Feb-11 13:48 
AnswerRe: AJAX Calender and SQL Server Pin
R. Giskard Reventlov23-Feb-11 22:03
R. Giskard Reventlov23-Feb-11 22:03 
GeneralRe: AJAX Calender and SQL Server Pin
SarfarajAhmed23-Feb-11 22:52
SarfarajAhmed23-Feb-11 22:52 
GeneralRe: AJAX Calender and SQL Server Pin
R. Giskard Reventlov24-Feb-11 1:45
R. Giskard Reventlov24-Feb-11 1:45 
GeneralRe: AJAX Calender and SQL Server Pin
SarfarajAhmed24-Feb-11 11:01
SarfarajAhmed24-Feb-11 11:01 
Questionmultiple calls to Sys.Application.notifyScriptLoaded() Pin
Ali AlOmairi (TJIC)23-Feb-11 3:27
Ali AlOmairi (TJIC)23-Feb-11 3:27 
AnswerRe: multiple calls to Sys.Application.notifyScriptLoaded() Pin
omar ibrahim23-Feb-11 11:59
omar ibrahim23-Feb-11 11:59 
GeneralRe: multiple calls to Sys.Application.notifyScriptLoaded() Pin
Ali Al Omairi(Abu AlHassan)23-Feb-11 12:05
professionalAli Al Omairi(Abu AlHassan)23-Feb-11 12:05 
QuestionIframe page login not working fine in IE...,But working fine in Mozila browser..., Pin
Member 387988122-Feb-11 22:29
Member 387988122-Feb-11 22:29 

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.