locked
Visual Studio Flavor Projects and the Project Upgrade - Gets caught in a permanent loop of perpetually upgrading the project. RRS feed

  • Question

  • We have a Flavor project which we have converted from VS 2008 to VS 2010, which implements the IVsProjectUpgrade interface in the project to perform project upgrades. The reason why we use the IVsProjectUpgrade interface is that as our software changes, we need to upgrade the contents of our flavour projects to reflect the changes in our software, and this interface fires on every opening of the project.

    When we converted the solution to VS 2010 we have noticed the following strange behaviour with existing VS2008 solutions. What appears to happen is the following (after debugging through the code):

    1. The solution starts upgrading to VS 2010
    2. The solution loads our project
    3. The IVsProjectUpgrade implementation fires within our flavor project - which updates the project file and saves correctly.
    4. Something then overwrites the project file with another version, which does not contain our updated elements.
    5. The solution wizard completes.

    When the solution is next opened, the Wizard kicks in again, but has exactly the same effect.

    If I create a blank VS 2010 solution and add an existing VS2008 instance of one of our flavor projects, this upgrades correctly - so this definately seems related to the upgrade of the Solution happening at the same time.

    What we have noticed is that when a solution upgrade is being performed the project file has a new element added to it <FileUpgradeFlags>0</FileUpgradeFlags>


    If the file upgrade flags has any value at all then the solution persists in attempting to upgrade, however if I manually remove this from the project file, then the solution stops attempting to upgrade, and our project upgrade fires correctly.

     

    Can anyone explain the required behaviour to get this scenario working correctly for a solution upgrade ? What seems to be especially puzzling is that fact that the project file is being overwritten by something after our project upgrade code has finished executing.

     

    Thanks in advance.


    Peter

    Friday, October 8, 2010 10:32 AM

Answers

  • Hi Peter,

    This is going to take a repro that the support team can debug, so that we can figure out what going on here. At this point I'm going to recommend opening a support incident with Microsoft Developer Support, and have someone on the VS Extensibility Support team try to troubleshoot/debug this.

    Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Sincerely,


    Ed Dore
    Thursday, October 28, 2010 3:42 AM

All replies

  • Hi Peter,

    This is going to take a repro that the support team can debug, so that we can figure out what going on here. At this point I'm going to recommend opening a support incident with Microsoft Developer Support, and have someone on the VS Extensibility Support team try to troubleshoot/debug this.

    Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Sincerely,


    Ed Dore
    Thursday, October 28, 2010 3:42 AM
  • Hi Peter,

    Have you looked into implementing IVsProjectUpgradeViaFactory interface ??

    Specifically 'UpgradeProject(...)' - which gives you the opportunity to mess with the project-file _before_ the project is loaded into the solution.  IOW - you can upgrade the file yourself using your own file markers.  The "UpgradeProject_CheckOnly()" method seems to be called whenever a solution is loaded.

    Hope this helps,
    Reed Shilts

    • Proposed as answer by Reed Shilts Friday, November 12, 2010 6:19 PM
    Friday, November 12, 2010 6:19 PM