473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Specifying a log for a Service

Hi people

I am trying to set the log for my service in the installer class (System.Configuration.Install.Installer). I override Install and Uninstall. The install method looks like this

public override void Install(IDictionary stateSaver

if( !EventLog.SourceExists(MyServiceName)
EventLog.CreateEventSource(MyServiceName, MyLogName)
base.Install(stateSaver)
The MyServiceName is the same as the name of my service

The installer complains "Source MyServiceName already exists on the local computer". But (1) I am explicitely checking whether the source exists before creating the source(!!!), and (2) my log has a completely different name (MyLogName) than the existing logs (Application...), and (3) creating an Event source requires both the source name and the log name. This doesn't seem very logical. The error message

<error_message
[...
Installing service MyServiceName..
Service MyServiceName has been successfully installed
Creating EventLog source MyServiceName in log Application..

An exception occurred during the Install phase
System.ArgumentException: Source MyServiceName already exists on the local computer
[...
</error_message

At line 3 you can see that the installer is creating the source behind my back; for log Application. Then the exception occurs. I seem to be creating a source that already exists, BUT in my code I explicitely CHECK whether the source already EXISTS before creating it. Plus I register the source for ANOTHER log than Application (MyLogName)

Pffff. If I get grey hair before I'm thirty, I'll definitely know why ... Does anyone have any idea

Thank you
Tom
Nov 16 '05 #1
0 2199

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Amittai Aviram | last post by:
This XHTML 1.0 Strict page -- http://www.studiolirico.org/docs/settimana2003.html has a bilingual title in Italian and English. The principle language of the page is Italian, so the <html> tag...
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
0
by: Bruno Jouhier | last post by:
I have a standard Web Service developped with ASP .NET and I would like to specify annotations on some properties exposed by my web service, and to have these annotations appear in the WSDL, but I...
0
by: TT (Tom Tempelaere) | last post by:
Hi people I am trying to set the log for my service in the installer class (System.Configuration.Install.Installer). I override Install and Uninstall. The install method looks like this public...
1
by: Adam Eccleshall | last post by:
Hi, I'm trying to write a routine to extract results from a web service written in VS 2005 using XPath, however VS doesn't put a prefix on result namespaces by default, so in the output from a...
4
by: Jason Richmeier | last post by:
I am sure this has been asked at least once before but I could not find anything when searching. If I set the value of the ExitCode property to 1066 for a windows service, the text "A service...
0
by: supercodepoet | last post by:
What I have is a .NET 2.0 C# web service for quoting a tax rate. The current response wrapped in the SOAP envelope and body is : <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
1
by: zufie | last post by:
Hi, I want to specifying a foreign key by altering a table. First, I create an ORDERS table without specifying a foreign key. Here is my code: CREATE TABLE ORDERS (Order_ID integer,...
0
by: clarkemi | last post by:
Have implemented: protected override WebRequest GetWebRequest(Uri uri) { HttpWebRequest request = (HttpWebRequest) base.GetWebRequest(uri); request.KeepAlive = false; return request;...
2
by: Jeff Dege | last post by:
I have a VS2005 Web Site that's giving me some trouble. Our process model requires that all shipped applications be compiled on a dedicated compile box, straight from version control, without...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.