You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
Open a .csproj or .targets file with at least one PackageReference
Change the PackageReference from Include to Update. (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)<---
The text was updated successfully, but these errors were encountered:
cdonnellytx
added a commit
to cdonnellytx/ProjFileTools
that referenced
this issue
May 5, 2020
Installed product versions
Description
Code completion fails to work if the
PackageReference
tag uses theUpdate
attribute instead ofInclude
, 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:
Steps to recreate
PackageReference
PackageReference
fromInclude
toUpdate
. (Or add example above)Current behavior
Throws an exception (see below)
Expected behavior
Code complete version based off the
Update
key instead of the nonexistentInclude
key.Error with stack trace
The text was updated successfully, but these errors were encountered: