Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Capturing The Build Date Into Code

Capturing The Build Date Into Code

Scheduled Pinned Locked Moved C#
csharpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bneacetp
    wrote on last edited by
    #1

    Is there any way to insert the date of a project's build into a string variable automatically in C# without me having to manually change the date? Thanks in advance. :)


    John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."

    H 1 Reply Last reply
    0
    • B bneacetp

      Is there any way to insert the date of a project's build into a string variable automatically in C# without me having to manually change the date? Thanks in advance. :)


      John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."

      H Offline
      H Offline
      hamster1
      wrote on last edited by
      #2

      Don't know about automatic... I would use the PreBuild event, there you can call a simple generator which might create something like "CurrentData.cs", content would be then a simple "const string CURRENT_DATE=...". ---------------------- ~hamster1

      B 1 Reply Last reply
      0
      • H hamster1

        Don't know about automatic... I would use the PreBuild event, there you can call a simple generator which might create something like "CurrentData.cs", content would be then a simple "const string CURRENT_DATE=...". ---------------------- ~hamster1

        B Offline
        B Offline
        bneacetp
        wrote on last edited by
        #3

        Pardon my ignorance, but how would I deal with the PreBuild event (e.g.- is it a member of a certain class in .NET or a feature of the Visual Studio .NET IDE?) or could you at least please point me in the right direction to help me out. I'd appreciate it. :)


        John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."

        H 1 Reply Last reply
        0
        • B bneacetp

          Pardon my ignorance, but how would I deal with the PreBuild event (e.g.- is it a member of a certain class in .NET or a feature of the Visual Studio .NET IDE?) or could you at least please point me in the right direction to help me out. I'd appreciate it. :)


          John 3:16: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."

          H Offline
          H Offline
          hamster1
          wrote on last edited by
          #4

          In VS.NET, open Solution Explorer, right-click on your project (.exe). Go to Properties > Common Properties > Pre-build... What you type there is basically a batch file. ---------------------- ~hamster1

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups