473,405 Members | 2,167 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,405 software developers and data experts.

Correct filename for events

Hi;

I have event logging working now (thank you all for the help). But we now
need to add doing this to our setup program. The file on my system is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Even tLogMessages.dll

So my question is how do we programatically get this path and filename?
1) Where do we get the C:\WINDOWS\Microsoft.NET\Framework part from? Do we
just add Microsoft.NET\Framework to the windows directory?
2) The v2.0.50727 part - do we build that from the AppDomain version number
or somewhere else?
3) Is the filename hardcoded as EventLogMessages.dll?

I don't want our stuff to break if a new version comes out.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Nov 17 '06 #1
3 1124
Hey David,

You can get the current .NET Framework location using this call

string runtime =
System.Runtime.InteropServices.RuntimeEnvironment. GetRuntimeDirectory()
--
Bits. Bytes.
http://bytes.thinkersroom.com
------------------------------
"David Thielen" wrote:
Hi;

I have event logging working now (thank you all for the help). But we now
need to add doing this to our setup program. The file on my system is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Even tLogMessages.dll

So my question is how do we programatically get this path and filename?
1) Where do we get the C:\WINDOWS\Microsoft.NET\Framework part from? Do we
just add Microsoft.NET\Framework to the windows directory?
2) The v2.0.50727 part - do we build that from the AppDomain version number
or somewhere else?
3) Is the filename hardcoded as EventLogMessages.dll?

I don't want our stuff to break if a new version comes out.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Nov 17 '06 #2
Hi Dave,

You can use RuntimeEnvironment.GetRuntimeDirectory() to get the
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ part.

#RuntimeEnvironment.GetRuntimeDirectory Method
(System.Runtime.InteropServices)
http://msdn2.microsoft.com/en-us/lib...pservices.runt
imeenvironment.getruntimedirectory.aspx

This is assuming you're creating the installer code in .NET. Let me know if
this is not the case.

For the "EventLogMessages.dll", it should be pretty safe to hard code its
name.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '06 #3
Exactly what I needed - thanks

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


"Walter Wang [MSFT]" wrote:
Hi Dave,

You can use RuntimeEnvironment.GetRuntimeDirectory() to get the
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ part.

#RuntimeEnvironment.GetRuntimeDirectory Method
(System.Runtime.InteropServices)
http://msdn2.microsoft.com/en-us/lib...pservices.runt
imeenvironment.getruntimedirectory.aspx

This is assuming you're creating the installer code in .NET. Let me know if
this is not the case.

For the "EventLogMessages.dll", it should be pretty safe to hard code its
name.

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '06 #4

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

Similar topics

0
by: Tero Saarni | last post by:
I'm using Logging in my library module for producing trace log of certain events. For being more useful these log entries should be associated with the filename and line number of *users* code...
1
by: mathlec | last post by:
I'm struggling with an odd problem and I want to validate something. What is the right way to load an assembly from bytes? Is this code correct? : .... Private Function loadBytes(filename...
1
by: Deadly_M | last post by:
Is it possible to get the build / version number into the .exe or .msi filename ? ie. "mycode1.01.1091.exe" Thanx in advance _____________________________________ Matthew Purves ,...
7
by: garyusenet | last post by:
Hi I have finally made progresss with my use of the open file dialog box! I have now made my own method that opens the dialog box and returns the file selected. Can you please have a quick...
15
by: Larry Bud | last post by:
I rarely crosspost, but this affects both ASP and Javascript REALLY odd bug that I ran across in ASP 3.0. I have an input type of file, user clicks browse, then places his cursor in the...
3
by: luke.hoersten | last post by:
I'm looking for a good example of how to correctly abstract TK code from the rest of my program. I want to just get some user info and then get 4 values from the GUI. Right now I've written it OOP...
0
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code HttpContext context = HttpContext.Current; context.Response.ContentType =...
0
by: Darqer | last post by:
Hello There is a possibility to show DownloadFile form in web browser using following peace of code Code: ( text ) HttpContext context = HttpContext.Current; ...
7
by: BiffMaGriff | last post by:
I have an query I run against an Oracle Connection. I have these objects, an event table and a table to map my objects to my events. My select statement selects the most recent event for each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.