This project has moved. For the latest updates, please go here.

Update User Defined Project Property in an MSBuild Task (Building From VS2010, not MSBuild)

Topics: Developer Forum, User Forum
Jun 19, 2014 at 5:20 PM

This is a followup to a question I asked awhile back (Updating HelpFileVersion Dynamically Using MSBuild Targets (From VS2010).

At that time, I was trying to update the SHFB HelpFileVersion property from the BeforeHelpBuild build task. The response I accepted from that thread was that Visual Studio only edits project properties found at the project's root level and is not aware of any changes made within a separate build task. I have been unloading/reloading my projects since. Eric's discussion about how the build task gets the project instance makes sense and maybe my followup question is not possible. Either way, I realize this is not a SHFB issue, but I was hoping for some ideas on a possible workaround.

So, I am now faced with a similar dilema using a User Defined property. Again, the value of my property is being parsed from a file, so it picks up the updated value as long as I reload the project (or update the file before loading my solution). It turns out that unloading the project is often overlooked (by more than just me!), and build automation does not make the most sense for our setup, so I really need the ablilty to update my property in the BeforeHelpBuild build task.

Does anyone know a way to update Visual Studio's instance of a project property in (or in response to) an MSBuild task? Thanks for any tips, you guys rock.