How to: Upgrade Project Items
Visual Studio SDK partners that add or manage items inside project systems they do not implement may need to participate in the project upgrade process. In Visual Studio 2005, Crystal Reports is an example of an item that can be added to the project system.
Typically, project item implementers want to leverage an already fully instantiated and upgraded project because they need to know what the project references are and what other project properties are there to make an upgrade decision.
To get the project upgrade notification
Set theflag (defined in vsshell80.idl) in your project item implementation. This causes your project item VSPackage to auto load when the Visual Studio shell determines that a project system is in the process of upgrading.
Advise theinterface via the method.
The IVsSolutionEventsProjectUpgrade interface is fired after the project system implementation has completed its upgrade operations and the new upgraded project is created. Depending on the scenario, the IVsSolutionEventsProjectUpgrade interface is fired after the, the , or the methods.
To upgrade the project item files
You must carefully manage the file backup process in your project item implementation. This applies in particular for a side-by-side backup, where the fUpgradeFlag parameter of the method is set to , where files that had been backed up are placed along side files that are designated as ".old". The backed up files older than the system time when the project was upgraded can be designated as stale. Furthermore, they might be overwritten unless you take specific steps to prevent this.
At the time your project item gets a notification of the project upgrade, the Visual Studio Conversion Wizard is still displayed. Therefore, you should use the methods of theinterface to provide upgrade messages to the wizard UI.