Repository navigation
Description
From @vsfeedback on June 16, 2018 15:5
- git clone https://github.com/dotnet/docfx.git
- open the All.sln
- error: The project system has encountered an error.
Internal error: Critical capabilities changes were detected without any change made to the project 'Microsoft.DocAsCode.Metadata.ManagedReference.FSharp.Tests.fsproj', and forces the project to be reloaded. Potential capabilities involved: 'FSharp'.
I meet this error after upgrading to vs 15.7.3. I found several issues with similar error message that have been fixed in 15.3, but I think it's not the same issue for me.
Details:
LimitedFunctionality
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Internal error: Critical capabilities changes were detected without any change made to the project 'Microsoft.DocAsCode.Metadata.ManagedReference.FSharp.fsproj', and forces the project to be reloaded. Potential capabilities involved: 'FSharp'.
at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.<RequestReloadForIncompatibleCapabilitiesAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
--- 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 'Microsoft.DocAsCode.Metadata.ManagedReference.FSharp.fsproj', and forces the project to be reloaded. Potential capabilities involved: 'FSharp'.
at Microsoft.VisualStudio.ProjectSystem.ProjectCapabilitiesRequirementsService.<RequestReloadForIncompatibleCapabilitiesAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>b__0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---
This issue has been moved from https://developercommunity.visualstudio.com/content/problem/267201/critical-capabilities-changes-were-detected-withou-1.html
VSTS ticketId: 626735
These are the original issue comments:
(no comments)
These are the original issue solutions:
(no solutions)
Copied from original issue: dotnet/fsharp#5205
Activity
davkean commentedon Jun 27, 2018
From @cartermp on June 16, 2018 15:6
This might need to go under dotnet/project-system
davkean commentedon Jun 27, 2018
From @cartermp on June 18, 2018 17:28
@TIHan FYI
davkean commentedon Jun 27, 2018
This line here: https://github.com/dotnet/project-system/blob/master/src/Microsoft.VisualStudio.ProjectSystem.FSharp.VS/Packaging/FSharpProjectSystemPackage.cs#L23 is supposed to prevent this capability from being "dynamic" (comes and going based on what packages/targets are installed).
davkean commentedon Jun 27, 2018
I can repro 100% on 15.7, cannot repro on 15.8.
davkean commentedon Jun 27, 2018
Okay I know the cause, these projects aren't real F# projects. They are C# projects that someone has renamed to fsproj. When loading, they start off as "CSharp" due the C# factory in the solution, and only latter when we evaluate the project does the "FSharp" capability arrive from targets files. We have F# components that must be loaded during startup, hence critical capability, - so CPS faults.
The fix is for someone to File -> New F# project and add it manually to the solution. The solution is currently telling VS that the project should be loaded using "C#" project system.
I'll leave this bug open, as I'd like for us to handle this situation better - it's kind odd/powerful that we don't care about the extension of the project at all when determining the default set of capabilities.
davkean commentedon Jun 27, 2018
tag @superyyrrzz on this version.
davkean commentedon Jun 27, 2018
I thinking maybe we should just Veto the load if the expected "default" capabilities aren't present (but we need at least one?) via IVetoProjectPreLoad or always force default capabilities based on extension.
superyyrrzz commentedon Jun 27, 2018
@davkean Thank you for the information! I will try the fix.