locked
IVCRulePropertyStorage methods throw exception after VS 2019 16.6 update RRS feed

  • Question

  • Hi,

    I am working on a extension setting debug properties for C++ projects. After update to VS 2019 version 16.6 methods IVCRulePropertyStorage.GetUnevaluatedPropertyValue() and IVCRulePropertyStorage.SetPropertyValue() are throwing exception with message "Error HRESULT E_FAIL has been returned from a call to a COM component.", on SOME projects (on other it still works).
    They were working fine with previous VS versions and I changed nothing in extension code or solution/projects I am testing it on since.

    My code (based on article from msdn titled "Working with Visual C++ Project Properties" - can't paste link) is as follows:

    DTE2 dte = GetService(typeof(DTE)) as DTE2;
    Project project = dte.Solution.Projects.Item(1);
    VCProject prj = (VCProject)project.Object;
    VCConfiguration conf = prj.Configurations.Item("Debug|x64");
    IVCRulePropertyStorage local = conf.Rules.Item("WindowsLocalDebugger") as IVCRulePropertyStorage;
    string propertyValue = local.GetUnevaluatedPropertyValue("LocalDebuggerCommand");

    I am not able to debug this COM object not having symbol files for VCProjectEngine.dll which is inside VS directories. Also I do not know any other method to get/set these properties. What do you suggest my next course of action should be?

    Thanks,
    Maciej

    Tuesday, June 30, 2020 10:39 AM

Answers

  • Thank you for your reply.

    Unfortunately this solution did not work for me.
    However after much looking around I stumbled upon Microsoft.VisualStudio.VCProjectEngine.VCConfiguration.DebugSettings property, which allows me to get and set all the properties that were originally accessed the way I posted, so my problem is solved.

    Best Regards,
    Maciej

    Thursday, July 2, 2020 8:24 AM

All replies

  • Hi Macejgrzywacz,

    Please try to delete .vs folder, bin and obj folders, then try to re-build vsix project.

    If this error is not solved, please follow these steps:

    1. Run Developer Command Prompt for visual studio 2019 as administrator
    2. Type [gacutil -i "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.VCProjectEngine.dll"], then run
    3. Restart visual studio to rebuild your project

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, July 1, 2020 2:55 AM
  • Thank you for your reply.

    Unfortunately this solution did not work for me.
    However after much looking around I stumbled upon Microsoft.VisualStudio.VCProjectEngine.VCConfiguration.DebugSettings property, which allows me to get and set all the properties that were originally accessed the way I posted, so my problem is solved.

    Best Regards,
    Maciej

    Thursday, July 2, 2020 8:24 AM