This project is read-only.

TfsVersion + AssemblyInfo = Good?

Apr 8, 2009 at 1:30 AM

Currently I am using TfsVersion to version my assemblies in Team Build (it has been working like a champ!)

However now I want to use AssemblyInfo to update just the AssemblyConfiguration attribute on my assemblies.  Can I do this in addition to TfsVersion?  I don't see any samples so I'm having to venture on my own here. :)

Thanks... this is such an amazing collection of tasks!

-- MichaelD
Apr 8, 2009 at 6:24 PM
Hi Michael

To set the AssemblyConfiguration you would call something like this:

            <AssemblyInfoFiles Include="*ALL YOUR*\AssemblyInfo.cs"/>
        <MSBuild.ExtensionPack.Framework.AssemblyInfo AssemblyConfiguration="*YOUR CONFIG*" AssemblyInfoFiles="@(AssemblyInfoFiles)"/>

Does that help?

Let me know and I will update the documentation.

Apr 8, 2009 at 7:07 PM
OK that looks AWESOME... just how I'd expect it.  However, the documentation does mention a lot about versioning and what not.  Will this task update versioning even though no parameters are defined?

Finally, should I do this before or after the TfsVersion?  Or does it not matter?

Thanks again for replying!
Apr 8, 2009 at 7:31 PM
Right I understand your full question now.

You should be fine to call the tasks independently if you just use the basic AssemblyInfo call above, though a more efficient way would be

       <MSBuild.ExtensionPack.Framework.AssemblyInfo AssemblyConfiguration="*YOUR CONFIG*" AssemblyInfoFiles="@(AssemblyInfoFiles)" SkipVersioning="true"/>

Apr 8, 2009 at 8:38 PM
I guess I could learn a lot more by being patient and actually checking out the properties. :)  This is awesome.  The breadth of this framework continues to amaze me. 
Apr 20, 2009 at 7:42 PM
Well I *finally* got around to trying this out, but I'm getting access denied exceptions on the (read-only) files.  I think TfsVersion automagically handles this, but it appears that AssemblyInfo doesn't?  Any way we can make these consistent? :)

In the meantime I'm sure there's an easy task somewhere that makes these files readonly... I'mma dig for it.
Apr 20, 2009 at 7:51 PM
Alright, I got the files to a Normal state by using the File task.  However, it appears that AssemblyInfo fails when it cannot find an AssemblyConfiguration in a given file.  It would be very nice to have a setting to not fail when this condition occurs.
Apr 20, 2009 at 10:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 20, 2009 at 10:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.