line breaks in assembly description

I have several solutions that I work on in parallel.

How can I use a single location to update the version number to set on all solutions

Can I add something like an .h file in C to include in every solution and when building the solution the assembly version will be updated as in the common location.

For example, I want to set a version of 2.3.*.* on three different solutions - I have no other way than changing the AssemblyInfo file for each of them manually.

If it cannot be done - do you know of an external tool to accomplish the task

Thank you.



Answer this question

line breaks in assembly description

  • nicpn

    Worked like a charm! Big Smile
    Thank you again...

    I found on other sites on the web that for an obscure reason file linking is not possible in web solutions under visual studio 2003. Is that correct

    http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.languages.csharp/2005-03/0731.html

    Is there a way I can have the same assembly version derived from one location for both web solutions and windows forms solutions


    Thank you,
    Dror.

  • Mallioch

    thank you- i think it's better to manually change the version number in my web solutions than all this hassle with VSS...

    thank you anyway!

  • pijcke

    Perfect!!!Big Smile

    thank you - just what i needed!

    how can i add a linked file to a web solution

    if we're at it - how can i (is it possible to) set the assembly description with multiple lines to ease the reading of it


    [assembly: AssemblyDescription("This assembly will perform actions on ISA 2004.\n" + "The actions available are:\n" +
    " stop - this will stop the ISA firewall. usage: ISAAction.exe stop\n" +
    " start - this will start the ISA firewall. usage: ISAAction.exe start\n" +
    " enable - this will enable Infogin filter in the ISA. usage: ISAAction.exe enable\n" +
    " disable - this will disable Infogin filter in the ISA. usage: ISAAction.exe disable\n" +
    " clear - this will clear the ISA cache. usage: ISAAction.exe clear")]


     



    as you can see in the snippet i want a line break at the end of each use case.

    this is not a critical issue.

    thank you!


  • amadas

    The version number is in the AssemblyInfo.cs by default, but there is no reason it needs to be there. There is nothing special about this particular .cs file. On large applications (which are composed of multiple projects), I typically break apart AssemblyInfo.cs into two parts - project-related info and solution-related info. For instance, AssemblyCompany, AssemblyTrademark, AssemblyVersion, AssemblyKeyFile, etc. are consistent across all my projects. AssemblyTitle and AssemblyDescription are changed per project. I keep the project-specific ones in AssemblyInfo.cs (one for each project). Cross-project settings I keep in CommonAssemblyInfo.cs.

    1. Copy AssemblyInfo.cs to the Solution directory.
    2. Rename it to CommonAssemblyInfo.cs.
    3. Add it to the solution via right-click Solution... Add... Add Existing Item...
    4. Add it to each project via right-click Project... Add... Add Existing Item... IMPORTANT: Click on the down arrow beside open and select Link File.

    You'll now have one copy under source control. All your projects will reference this one file. You can manually update the version number in CommonAssemblyInfo.cs or have your build script update it.



  • Aaron_1234

    Glad to help. As you've probably realized, AssemblyTitle maps to file properties "Description" and AssemblyDescription maps to Comments. (Why is beyond me!) To insert linebreaks you need to include both the CR and LF as is typical in Windows text files. So use "\r\n" wherever you have "\n".

    [assembly: AssemblyDescription("This assembly will perform actions on ISA 2004\r\n" +
     "The actions available are:\r\n" +
     " stop - this will stop the ISA firewall. usage: ISAAction.exe stop\r\n" +
     " start - this will start the ISA firewall. usage: ISAAction.exe start\r\n" +
     " enable - this will enable Infogin filter in the ISA. usage: ISAAction.exe enable\r\n" +
     " disable - this will disable Infogin filter in the ISA. usage: ISAAction.exe disable\r\n" +
     " clear - this will clear the ISA cache. usage: ISAAction.exe clear")]

  • AnonymousDus

    You are correct. Unfortunately file linking doesn't work for web projects. Your best bet in this case is to share the CommonAssemblyInfo.cs file using your source control system, such as VSS, Subversion, CVS, TeamSystem, or whatever you happen to be using. Your build process is slightly more complicated as you'll have to update one copy, commit it to your source control system, and then get latest to keep everything synchronized.



  • line breaks in assembly description