|
No one Replied me yet
|
|
|
|
|
I have an application in production that has intermittent errors. I would like to add an error tracking feature so that, when an error gets channeled through the global handling routines, an entry gets written to the Event Log. I would like for this entry to use an event source unique to the application, to better track the errors.
So following Microsoft's own documentation, I tried this:
If Not EventLog.SourceExists("MyApp") Then
EventLog.CreateEventSource("MyApp", "Application")
End If
MyLog.Source = "MyApp"
MyLog.WriteEntry(DetailedMessage)
Unfortunately, EventLog.SourceExists throws an exception: the Framework attempts to check ALL of the logs, not just "Application", and Vista's psychotic paranoia does not allow the Framework to check the System log. So I tried always creating the source and ignoring the "source already exists" exception, like this:
Try
EventLog.CreateEventSource("MyApp", "Application")
Catch ex As Exception
End Try
MyLog.Source = "MyApp"
MyLog.WriteEntry(TextBox1.Text.Trim)
That throws the same exception about the System log, this time on EventLog.CreateEventSource . Attempting to write the entry therefore causes a "source does not exist" exception.
The solutions I have been able to find involve creating the event source manually, by writing the key to the registry. The key gets put in HKEY_LOCAL_MACHINE/System. Vista's "virtualization" has a firm lock on that node and redirects all programatic reads and writes to an isolated, user specific zone. This apparently rules out having the application create the source, as three different users will create three different logs, none of which will be visible to me when I log in as an administrator. And because this app runs on about 40 different machines, it is not feasable to go around to every one and configure the registry manually.
At this point, I see two options:
1. Roll my own event log. Write the errors out to an XML file and write a simple viewer to present the information.
2. Roll every workstation in the office back to XP because I am fed up with Vista.
Please, anyone, is it possible to use the event log under Vista? If so, HOW?
|
|
|
|
|
Just like writing to the HKLM section of the registry, creating an
event source requires elevated privileges. And also just like writing to
HKLM in the registry, apps that runs without elevation need to do these operations
at install time (which is why many installers give you a UAC prompt).
From the EventLog class docs:
"If you write to an event log, you must specify or create an event Source.
You must have administrative rights on the computer to create a new event source."
TechBearSeattle wrote: Please, anyone, is it possible to use the event log under Vista? If so, HOW?
Yes. Provide some way to create the event source. Once the source is
registered, no elevation will be required for the app to write to the
event log.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I want to send email everyday using webServices. Can anyone give a code to do this?
Thanks and Regards.
|
|
|
|
|
Priya0609 wrote: Can anyone give a code to do this?
Yes.
You can.
You have all the keywords, the documentation and the internet,
Do you really have to ask being spoon fed?
Go search and read.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Priya0609 wrote: Can anyone give a code to do this?
This is not code shop
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi, which edition of visual studio (2008) can allow team of developer to work on the same project at a time and where can i get full documentation on it
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
HI guys which edition of visual studio 2008 can enable developers work on same project at atime. i want my team on a network to be able to work on different aspx pages on the same project. and where can i get full documentation on the edition
|
|
|
|
|
|
You can do this with virtually any edition of Visual Studio - all you need is a decent source configuration tool, and you can get those for free; e.g. Subervsion.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Ebube wrote: HI guys
BTW - this is a sexist remark. There are many women who frequent the forums, so please don't use the masculine form of address.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
DoctorMick wrote: PC gone mad?!?!?!
Nope - I just have a lot of respect for the likes of Anna-Jayne, Corrina, the fluffy Tigress and the likes. It's not right to assume they don't have the ability to answer - they are a lot smarter than a lot of the blokes I know. By assuming your target audience is male, you potentially alienate valuable sources of help.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I aplologise for using Hi guy. i meant the entire forum
|
|
|
|
|
That's all right - you'll remember the next time.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
"Guys" is a perfectly normal way to address a group of people, regardless of sex.
I hear women addressed like this all the time, never heard a complaint.
|
|
|
|
|
Hi all!
I want to design and implement an e-voting(electronic voting) system with two computers(one as server and the other as client) under windows;
What technology or programming model do you suggest me for this purpose?
I'm not familiar with network programming models in windows and need help of experience people to introduce me a suitable and applicable programming model and language for this case!
One guy have suggested me to create an ActiveX on client and communicate with server through COM, what do you think about it?
Please help me!!!
Best Regards.
|
|
|
|
|
Don't ask the same question in multiple forums.
Regards,
Karthik K...
|
|
|
|
|
Hi cp
i am new to CP. Just going to start a project for windows. Taking a quick leap to distributed application too soon.
Just want to know a solution for my scenario
I want to build a new windows distributed application (server/ Client). The client (.NET envoirnment)will be at a remote place outside the city (at any place) that shall be able to interact with the server (.NET envoirnment) for saving or retrieving data. On the server side the same application will be performing same tasks as the client side on LAN. There will be layers such as GUI,DAL,BLL(Bussiness logic), Controller and Data Types
1. Is it possible to have a same windows application at both sides (client and server )as i am presuming it to be?
2. What mechanism will be used for transporting data between the server and client
will it be a static IP address and http or something else i dont know?
3. Windows remorting or Web services will be useful for that?
i hope it will not bother anybody to help me.New to dot net so wanted to share and recieve ideas thanks
Thank every helper
|
|
|
|
|
Zeeshan Riaz wrote: i am new to CP
Just a quick recommendation for posting at CP (and most other places too) seeing as you're new, don't cross post i.e. post basically the same message in multiple forums. Pick one forum that best suits. If you're not sure, then I would post in one, and post a link to that post in another with an explanation that I wasn't sure where to post!
Welcome to CP
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
If an application which is configured for single-instance operation is run from a batch file, is there any nice way to control how long the batch file waits and what error code will be returned to it? The best approach I can figure would be to have a pair of programs: a windowed application that runs single-instance, and a console application that runs multi-instance. When run, the console application would invoke the single-instance application with a parameter containing something like a TCP socket. The single-instance application could then pass back the desired error code as well as any messages it would like the console application to display.
My intended use would be that the batch files do operations which may only be done one at a time, and to have the single-instance application sequence the operations, and then remain up after the operations are complete to show their status.
My target platform is .net 2.0. Any ideas?
|
|
|
|
|
Hi,
a single-instance app never really is single-instance. At best the second, third or whatever instance gets launched, detects it isn't number one, and exits again, hopefully after passing its work to the first instance, maybe by sending its command line through a pipe.
how about you make the "single-instance" such that it:
- detects it isn't the first;
- sends the job to the number one instance;
- instead of exiting right away, waits for completion.
Doing it that way your batch files don't have to be aware, they would always seem to be talking to the single-instance app.
BTW: obviously you can use the Main() method's return value as the batch/DOS exit code.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
What's the best way of achieving such a result in vb.net (I'm using 2005 at the moment)? Are there any nice template examples to borrow from?
|
|
|
|