This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
ArgumentNullException when using the Update attribute #68
Open
Description
Installed product versions
- Visual Studio: 2019 (16.4.2)
- This extension: 1.3.1 (installed via instructions in "Robert" review)
Description
Code completion fails to work if the PackageReference
tag uses the Update
attribute instead of Include
, throwing an exception.
This is in a repo where we have a Directory.Build.targets file to keep the versions of NuGet packages in sync by using the Update attribute to set a version that overrides any version specified in individual .csproj files. (We typically do not set a version in the .csproj anymore.)
Example syntax:
<PackageReference Update="System.Buffers" Version="4.5.0" />
Steps to recreate
- Open a .csproj or .targets file with at least one
PackageReference
- Change the
PackageReference
fromInclude
toUpdate
. (Or add example above) - Go to the Version attribute and invoke Intellisense to display the list of available versions.
Current behavior
Throws an exception (see below)
Expected behavior
Code complete version based off the Update
key instead of the nonexistent Include
key.
Error with stack trace
System.AggregateException: One or more errors occurred. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ProjectFileTools.NuGetSearch.Search.PackageSearchManager.SearchPackageInfo(String packageId, String version, String tfm)
at ProjectFileTools.PackageInfoControl..ctor(String packageId, String version, String tfm, IPackageSearchManager searcher)
at ProjectFileTools.QuickInfo.MsBuildPropertyQuickInfoSource.<GetQuickInfoItemAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<ComputeSourceContentAsync>d__39.MoveNext()
--- 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 ---
at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<UpdateAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoPresentationSession.<UpdateAsync>d__5.MoveNext()
---> (Inner Exception #0) System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ProjectFileTools.NuGetSearch.Search.PackageSearchManager.SearchPackageInfo(String packageId, String version, String tfm)
at ProjectFileTools.PackageInfoControl..ctor(String packageId, String version, String tfm, IPackageSearchManager searcher)
at ProjectFileTools.QuickInfo.MsBuildPropertyQuickInfoSource.<GetQuickInfoItemAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<ComputeSourceContentAsync>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---
Metadata
Metadata
Assignees
Labels
No labels