locked
Project System - "Critical capabilities changes" error RRS feed

  • Question

  • We have a custom project type (implemented in VS2015 as vsix2).  In VS2015, we have no issues; however, since VS2017 (same vsix project now using vsix3), we have been getting an error in solutions that contain multiple projects of this specific type:

    The project system has encountered an error.

    Internal error: Critical capabilities changes were detected without any change made to the project, and forces the project to be releoaded.

    Potential capabilities involved: 'CSharp'

    A diagnostic log has been written to the following location:

    "C:\Users\<user_name>\AppData\Local\Temp\VSProjectFault_688122e0-7ed6-4f3b-9f1c-efd7ad041790.failure.txt"

    By adding Capabilities = "mySpecialCapability;<other_capabilities...>;CSharp" to the ProjectTypeRegistration in the Unconfigured Project class, the line related to "CSharp" goes away, and we are left with the generic "Critical capabilities changes" error without any potential suggestions as to the cause.

    An example VsProjectFault log at this point is:

    =====================
    2017-04-05 4:09:12 PM
    Crippling
    System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Internal error: Critical capabilities changes were detected without any change made to the project, and forces the project to be reloaded.
       at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.RequestReloadForIncompatibleCapabilitiesAsync(IImmutableSet`1 capabilities)
       at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.CapabilityScopeRequirementState.<>c__DisplayClass8_0.<<InitialProjectReload>b__0>d.MoveNext()
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.InvalidOperationException: Internal error: Critical capabilities changes were detected without any change made to the project, and forces the project to be reloaded.
       at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.RequestReloadForIncompatibleCapabilitiesAsync(IImmutableSet`1 capabilities)
       at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.CapabilityScopeRequirementState.<>c__DisplayClass8_0.<<InitialProjectReload>b__0>d.MoveNext()<---

    ===================

    We have also tried adding capabilities to our myproject.myproj file:

    <ProjectExtensions>

       <ProjectCapability Include="mySpecialCapability" />
        <ProjectCapability Include="AssemblyReferences;COMReferences;ProjectReferences;SDKReferences" />
        <ProjectCapability Include="AllTargetOutputGroups;VisualStudioWellKnownOutputGroups" />
        <ProjectCapability Include="ProjectConfigurationsDeclaredAsItems" />
        <ProjectCapability Include="CSharp" />

    </ProjectExtensions>

    and also to our CustomProject.targets file:

    <ItemGroup>
        <ProjectCapability Include="mySpecialCapability" />
        <ProjectCapability Include="AssemblyReferences;COMReferences;ProjectReferences;SDKReferences" />
        <ProjectCapability Include="AllTargetOutputGroups;VisualStudioWellKnownOutputGroups" />
        <ProjectCapability Include="ProjectConfigurationsDeclaredAsItems" />
        <ProjectCapability Include="CSharp" />
      </ItemGroup>

    Resources we have used while attempting to fix this issue:

    https://github.com/Microsoft/VSProjectSystem/blob/master/doc/overview/dynamicCapabilities.md

    https://docs.microsoft.com/en-us/visualstudio/extensibility/creating-a-basic-project-system-part-1

    https://docs.microsoft.com/en-us/visualstudio/extensibility/internals/using-the-managed-package-framework-to-implement-a-project-type-csharp#using-the-mpf-project-source-code

    Wednesday, April 5, 2017 10:51 PM

All replies

  • Hi QRyanJones,

    if you want to upgrade from extension manifest version 2 (VSIX v2) to the new version 3 VSIX manifest format (VSIX v3). please refer to the following steps.

    1. Install Visual Studio 2017 with required workloads

    2.Open VSIX Solution in Visual Studio 2017

    3.Update the Microsoft.VSSDK.BuildTools NuGet package

    4. Make changes to the VSIX extension manifest

    5.Update Debug settings for project

    6.Check that the extension builds correctly (as a VSIX v3)

    7.Check when all required prerequisites are installed

    For more information, please refer to:

    https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-migrate-extensibility-projects-to-visual-studio-2017

    Best regards,

    Cole Wu


    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.

    Thursday, April 6, 2017 7:31 AM
  • Hi Cole,

    Thanks for your response.  Yes, we also used the page you mentioned and have followed these steps when we migrated to VSIX v3.  The updated extension typically runs correctly on VS2017.  It seems to be the particular scenario of opening a solution with multiple projects which causes this error to appear sometimes.  As mentioned, adding 'CSharp' as a capability has removed the "Potential capabilities involved: 'CSharp'" part of the error, but the remainder of the error persists.  We are wondering if the way we are specifying the capability is inadequate or if we need to do something else entirely to truly fix this issue.

    Please advise.

    Thanks,

    Ryan

    Thursday, April 6, 2017 5:32 PM
  • Hi QRyanJones,

    You could also build a VSIX v3 with Visual Studio 2015. There is a NuGet package which has the necessary tools and tasks to build VSIX v3 format manifests in Visual Studio 2015. Add a reference to NuGet package Microsoft.VisualStudio.Sdk.BuildTasks.14.0 to your extensibility project. You will also need to add the VsixType element specifying v3 to your project file:

    <VsixType>v3</VsixType>

    For more information, please refer to:

    https://github.com/Microsoft/visualstudio-docs/blob/master/docs/extensibility/faq-2017.md#can-i-build-a-vsix-v3-with-visual-studio-2015.

    And this is a sample for your reference.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/743061f9-98ea-4c22-881a-b144b0412cb8/can-i-build-a-vsix-v3-with-visual-studio-2015?forum=vsx

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; 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 <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Tuesday, April 25, 2017 6:59 AM