Home
Home copied to clipboard
Project files properties exception
Tool
Visual Studio extension
Description
I created a nanoframework applications. When I try to access the properties of the project file an exception is thrown.
How to reproduce
- Create new project
- Open project properties
- Select Application
Expected behaviour
No response
Screenshots
Aditional context
Visual Studio 2022 nanoFramework Extension 2022.1.0.25
Few more information to help in the work. The log error shows this:
08/06/2022 08:43:50
LimitedFunctionality
System.AggregateException: Project system data flow 'SupportedTargetFrameworksEnumProvider: 23275750' closed because of an exception.
The given key 'TargetFrameworkIdentifier' was not present in the dictionary. ---> System.Collections.Generic.KeyNotFoundException: The given key 'TargetFrameworkIdentifier' was not present in the dictionary.
at System.Collections.Immutable.ImmutableDictionary`2.get_Item(TKey key)
at Microsoft.VisualStudio.ProjectSystem.VS.Frameworks.SupportedTargetFrameworksEnumProvider.Transform(IProjectSubscriptionUpdate input)
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Derive[T,TOut](IProjectVersionedValue`1 projectVersionedValue, Func`2 transform)
at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformBlockSlimSync.ProcessInputAsync(TInput input)
at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.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.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.Collections.Generic.KeyNotFoundException: The given key 'TargetFrameworkIdentifier' was not present in the dictionary.
at System.Collections.Immutable.ImmutableDictionary`2.get_Item(TKey key)
at Microsoft.VisualStudio.ProjectSystem.VS.Frameworks.SupportedTargetFrameworksEnumProvider.Transform(IProjectSubscriptionUpdate input)
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Derive[T,TOut](IProjectVersionedValue`1 projectVersionedValue, Func`2 transform)
at Microsoft.VisualStudio.ProjectSystem.TransformBlockSlim`2.TransformBlockSlimSync.ProcessInputAsync(TInput input)
at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.<ProcessInputQueueAsync>d__5.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.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )<---
From the NFProjectSystem.CSharp.targets, there is this value:

So most likely there is something inconsistent here while .NET nanoFramework is not yet a proper SDK.
WOW! Nice finding. If that's what happening then we should look into this method.
As there is code there that is meant to handle situations where the moniker is not know, we need to figure out if we're providing a wrong or misleading property that's causing that exception.