• 0

Subversion hooks modifying file AssemblyInfo


Question

Here is my conundrum, I have a Visual Basic.NET project, I want the revision of the project to match that of the svn revision and to be updated dynamically but the only solutions I have found that 'work' without fault have to be installed on any computer that is going to work against the source code.

I.e. addition projects (such as using MSBuilds, svnRevisionlabeller, ...) or SubWCRev.exe (as in TortoiseSVN). All of which won't work if someone else uses a different svn client or I'd rather not have to import or use additional programs in my build process if I can use hooks in the repository itself to just update the AssemblyInfo file with the newest revision number.

Does anyone have any suggestions or am I just going to have to give in and use one of these solutions I listed earlier (leaning toward SubWCRev.exe)?

p.s. I am aware of the issues involved in modifying the content of a commit via hooks (and the working copy on the committing computer will not match, which is why I haven't attempted this yet).

3 answers to this question

Recommended Posts

  • 0

Dunno if I understood your requirement correctly (+ its 2:23 in the morning here), but why don't you automate the build process. When the build server retrieves the code from source control, set it up to update the assemblyinfo files accordingly (for example we use a date/time + revision versioning scheme so the build server updates the assembly info files (and some C++ resources) to match this scheme). Basically we never store version information in svn, its autogenerated on every build. That way we avoid the problem where the code in svn is different than the code on the dev's machine. Also, the build server would generally use the default command line client so it does not matter whether you guys use tortoisesvn or ankh to access svn.

  • 0

The way it is setup is anyone can check out the source code, there is no build server, only subversion+apache for source control. Anyone with Visual Studio can check it out and build it but AssemblyInfo.vb is the file generated by the Solution that holds the versioning info for the compiled application and it is updated by Visual Studio separately than the subversion revision number.

Example: AssemblyInfo version is set at 4.1.0.2, i can make all the changes I want and save and compile and it doesn't change (except I can set the build number to increment) whereas the svn commit increments the revision number. So the numbers won't ever be in sync with each other without some outside help, and since anyone can check out the code, I was hoping for a solution independent of their build environment (hence svn hook ideas). So VS could have 4.1.0.9 after a few compiles but with only one commit done, svn would be up by 1.

  • 0

I gave in and just used SubWCRev.exe included with TortoiseSVN to substitute svn revision number in the AssemblyInfo.vb file and added the command in the Pre-Build event.

What this means is that anyone not using TortoiseSVN as their SVN client, and tries to compile the code will error out (or warning out, not too sure as both my developing boxes have that program).

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Hello, I have had good results with Corsair, Crucial, Kioxia (formerly Toshiba), Nextorage, OWC, Patriot, Sabrent, Samsung, SanDisk (formerly Western Digital), Solidigm (formerly Intel) and Team Group SSDs.  Be sure to look at warranty length, and whether the drive uses TLC or QLC memory.  The former tends to be faster and lasts longer, but QLC is maturing and is usually less expensive.   Regards, Aryeh Goretsky  
    • Today's Windows 11 Preview Update (KB5062660) (26100.4770) was a pain in the royal butt. 1. It shut down one of my W11 devices during the update. I had to do a cold boot. The update then finished. 2. It rolled back the network adapter to April on both of my W11 devices. I updated the adapter to the June release, which promptly broke my internet connection. 3. I had to reboot my router and then restart both devices to get my internet connection back. There was one good thing about today's update. My utility software was finally able to update Notepad after several failed attempts before today's update. Anyway, all now appears GTG. Thank goodness.
    • Windows 11 receives a handful of new AI features by Taras Buria Microsoft is supercharging its operating system with a handful of new AI-powered features. Those with compatible computers (mostly Copilot+ PCs) can download a new Windows 11 update that introduces new AI experiences. One of the biggest updates is the Settings app, which now features agentic search to understand complaints about your computer. You can click the search box and tell Windows what is wrong. For example, "my mouse cursor is too small." Windows will then process your request and suggest taking action on your behalf. You can also ask for specific changes like, "change my screen resolution to 1920x1080." The Settings agent is now available for users with Snapdragon-powered Copilot+ PCs. It is coming soon to Intel and AMD-based Copilot+ PCs. Click to Do has received several new actions: Practice in Reading Coach helps improve reading skills by giving feedback and offering suggestions on how to improve. Read with Immersive Reader displays text in a distraction-free environment with the ability to adjust text size, spacing, font and background theme, have text read aloud, break words into syllables and highlight parts of speech. The picture dictionary shows images for unfamiliar words. Draft with Copilot in Word turns a portion of text into a full draft. Actions in Microsoft Teams let you click an email to send a message or schedule a meeting. More AI is available in the Photos app. After a couple of months in testing, the Relight feature is now rolling out, allowing users to adjust lights with AI. You can place three light sources or use built-in presets to edit your photos. Like with the Settings app, this feature is currently available to Snapdragon-powered devices only. Paint now has a sticker generator and a new object select tool that uses AI to isolate the object and edit individual elements, even if they are part of one layer. Snipping Tool has received the "Perfect Screenshot" feature to help you select parts of the screen for a proper cropped screenshot, and a new Color Picker to read colors on the screen in different formats (available on all PCs, not only Copilot+ PCs). Finally, the Copilot app now supports Highlights, a new feature that enables Copilot to show you how to perform specific tasks in the current app on the entire desktop. Today's updates are not just about AI and sticker generation. Microsoft is also improving the performance and security of its system with a redesigned blue screen of death and the new Quick Machine Recovery system. You can read more about those changes here. If you want to get all these updates today, download the latest non-security update for Windows 11 version 24H2, which is now available.
    • Well their mistake was choosing Microsoft, the backstabbers
  • Recent Achievements

    • Week One Done
      SmileWorks Dental earned a badge
      Week One Done
    • Community Regular
      vZeroG went up a rank
      Community Regular
    • Collaborator
      Snake Doc earned a badge
      Collaborator
    • Week One Done
      Snake Doc earned a badge
      Week One Done
    • One Month Later
      Johnny Mrkvička earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      586
    2. 2
      Michael Scrip
      199
    3. 3
      ATLien_0
      192
    4. 4
      +FloatingFatMan
      129
    5. 5
      Xenon
      122
  • Tell a friend

    Love Neowin? Tell a friend!