locked
Alternative to ProvideObjectAttribute RRS feed

  • Question

  • I am building a custom Visual Studio Project Flavor, so that I may add my own property pages.

    Something that I really dont like, is that I have to both register my property page at the package level with a [ProvideObjectAttribute] as well as at runtime in the override of GetProperty.

    As there a runtime way that I can avoid having to use the ProvideObjectAttribute? Perhaps I can perform the same work that the attribute does?

    Monday, February 14, 2011 9:31 PM

Answers

  • All the attributes in MPF are just used to generate registry information, they aren't reflected on at runtime, so yes you could do what it would otherwise be doing. Specifically see that information here about what registry entries it casues to be generated.

    Ryan

    Monday, February 14, 2011 11:51 PM
  • Or a PkgDef file, which would be the general approach, you are right that you shouldn't be writing these values at runtime, that is the job of an installer or your VSIX package (via its PkgDef file).

    Ryan

    • Marked as answer by Victor_Chen Monday, February 21, 2011 9:35 AM
    Tuesday, February 15, 2011 3:29 AM

All replies

  • All the attributes in MPF are just used to generate registry information, they aren't reflected on at runtime, so yes you could do what it would otherwise be doing. Specifically see that information here about what registry entries it casues to be generated.

    Ryan

    Monday, February 14, 2011 11:51 PM
  • Thanks Ryan,

    Unfortunately this is a no-go. For anyone else thinking about trying this, the Package at runtime does not have write privileges to the registrey (even HKCU) so that is why you have to rely on the package attribute to create the keys.

     

    Tuesday, February 15, 2011 1:13 AM
  • Or a PkgDef file, which would be the general approach, you are right that you shouldn't be writing these values at runtime, that is the job of an installer or your VSIX package (via its PkgDef file).

    Ryan

    • Marked as answer by Victor_Chen Monday, February 21, 2011 9:35 AM
    Tuesday, February 15, 2011 3:29 AM