locked
Detect change to project properties RRS feed

  • Question

  • Hi all,

    Hopefully a quick and easy question. I have a little add-in that I use to detect certain events in Visual Studio 2005. I now want to be able to detect when a project's properties have been changed (ie build path, application type, references). Does anyone know of such an event and how to hook into it.

    Thanks,

    Mark.

    Wednesday, February 28, 2007 1:29 AM

Answers

  • We do not offer any official way of detecting project property changes. The way you are using may work in some situations, but it is not guaranteed to work in all situations. This is something that we have been asked for a few times, you may want to open a bug on product feedback for tracking purposes in a future version of VS (if you open the bug, it is looked at more closely than if I were to open it).

    Craig

    Friday, March 9, 2007 12:08 AM

All replies

  • You can detect reference changes casting EnvDTE.Project.Object to VSLangProj.VSProject and then using VSProject.Events.ReferencesEvents, but AFAIK there is no way to detect property changed events, maybe using some service from the SDK
    Wednesday, February 28, 2007 6:53 AM
  • Hi Carlos,

    Thanks for your reply. I haven't had a chance to try it out but will use your suggestion to detect changes to project references.

    I have tried something that may help with detecting project property changes. Basically the add in detects when VS creates the Project Properties window, gets the IComponentChangeService and listens for ComponentChanging events. This seems to work OK for most of the project properties except Application settings. A ComponentChanging event does not occur until I have finished altering the settings and move away from the settings page. I do get a new WindowCreated event when the settings page is selected of RootComponent type Microsoft.VisualStudio.Editors.SettingsDesigner.DesignTimeSettings. I don't know if there is something from this object that could indicate the change in Application Settings as I cannot find much documentation on this class.

    I will try and play around with this object and see what I can do.

    Thanks,

    Mark.

    Thursday, March 1, 2007 6:37 AM
  • We do not offer any official way of detecting project property changes. The way you are using may work in some situations, but it is not guaranteed to work in all situations. This is something that we have been asked for a few times, you may want to open a bug on product feedback for tracking purposes in a future version of VS (if you open the bug, it is looked at more closely than if I were to open it).

    Craig

    Friday, March 9, 2007 12:08 AM