473,408 Members | 1,676 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,408 software developers and data experts.

__DATE__ and __FILE__ equivalents.

Are there compile date/time and file line equivalents for __DATE__ and
__FILE__ in C#?
Nov 16 '05 #1
2 3811
Jeffrey,

These things do not exist in C#. You will have to embed that
information in your code somehow. When you compile your assemblies in debug
mode, the file information is included by default. As for the compilation
date, you are going to have to embed that yourself (through the use of an
attribute, perhaps).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jeffrey Bradshaw" <je**@DontEvenBother.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Are there compile date/time and file line equivalents for __DATE__ and
__FILE__ in C#?

Nov 16 '05 #2
you could do create a new StackTrace() object so you know in which file you
are.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Jeffrey Bradshaw" <je**@DontEvenBother.com> schrieb im Newsbeitrag
news:#H**************@TK2MSFTNGP11.phx.gbl...
Are there compile date/time and file line equivalents for __DATE__ and
__FILE__ in C#?

Nov 16 '05 #3

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

Similar topics

1
by: Chris Pomasl | last post by:
Does no one have any insight?......please? Chris -------- Original Message -------- Subject: Problem with __FILE__ magic constant Date: Tue, 06 Jan 2004 16:43:41 GMT From: Chris Pomasl...
5
by: Ben Hetland | last post by:
I want something like content of __DATE__ compiled into my binary. (Being the date of compilation that is important.) However, I'd like the compiled-in string to be in the ISO standard format...
7
by: Erik Cato | last post by:
Hi group! Anyone know a way to convert the __DATE__ predefined macro into a unsigned int representing the current date? It should be possible to make out what date it was from the beginning. My...
2
by: Christopher Benson-Manica | last post by:
Recently a great example of converting __DATE__ into an integer via preprocessor tricks was posted. I've been trying to accomplish something similar - convert __DATE__ into a string in the format...
18
by: Lukas Ruf | last post by:
Dear all, for debugging purposes, I like the pre-compiler macros __FILE__, __FUNCTION__, __LINE__ I have been wondering if there is a short form of __FILE__ that provides only the filename...
1
by: cbro | last post by:
Is there a C# equivalent for the C++ macros __FILE__ and __LINE__ ? They are quite handy for pinpointing where an event log entry was generated. I am using Visual Studio.NET 2003.
1
by: Sagaert Johan | last post by:
Hi Are there any predefined constants i could use in my C# code similar to __DATE__ __FILE__ __LINE__ in c++ ? Johan
4
by: 7stud | last post by:
Hi, I'm having trouble understanding what the definition of __file__ is. With this program: ------ #data.py: def show(): print __file__
1
by: Zero | last post by:
Hello all, is it possible to change the format of __FILE__ + __DATE__, for example instead of hh:mm:ss ss:mm:hh? Where can I get information on this topic?
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.