Home icon indicating copy to clipboard operation
Home copied to clipboard

Project files properties exception

Open Bengkel opened this issue 3 years ago • 2 comments

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

  1. Create new project
  2. Open project properties
  3. Select Application

Expected behaviour

No response

Screenshots

image

Aditional context

Visual Studio 2022 nanoFramework Extension 2022.1.0.25

Bengkel avatar Apr 18 '22 05:04 Bengkel

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: image

So most likely there is something inconsistent here while .NET nanoFramework is not yet a proper SDK.

Ellerbach avatar Jun 08 '22 06:06 Ellerbach

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.

josesimoes avatar Jun 08 '22 08:06 josesimoes