Skip to content

[Bug Bash] An argument exception error will occur when second restoring the non-SDK style project which had installed vulnerable package with 'PackageReference' format #14702

@v-luzh

Description

@v-luzh

NuGet Product Used

Visual Studio Package Management UI

Product Version

VS Main/11322.50 + NuGet Client Dev/7.3.0.48

Worked before?

It is a regression since it doesn’t repro on D18.0\11304.174.

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Note:

  1. Repro rate: 100%.
  2. It doesn’t repro on .NET SDK based project.

Repro Steps:

  1. Create a C# Console App (.NET Framework 4.8.1) in VS and open the project-level PM UI.
  2. Select the package source ‘nuget.org’ from the ‘Package sources’ list and go to ‘Browse’ tab.
  3. Install a vulnerable package (for example, Newtonsoft.Json 12.0.2) with ‘PackageReference’ format and open the Solution Explorer window.
  4. Right-click the solution node and click the context menu “Restore NuGet Packages”.
  5. Right-click the solution node and click the context menu “Restore NuGet Packages” again.

Expected Result:

No error occurs.

Actual Result:

An argument exception error will occur as the screenshot below. Clicking the link ‘ArgumentException’ will show the dialog: Illegal characters in path.

Image

Verbose Logs

#### Error info (after clicking the ‘OpenLogfile’ link in above screenshot)

<entry> <record>1136</record> <time>2025/12/26 05:57:16.666</time> <type>Error</type> <source>Editor or Editor Extension</source> 
<description>System.ArgumentException: Illegal characters in path. 
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetExtension(String path) 
at Microsoft.VisualStudio.Conversations.QuickActions.LanguageFixCodeServiceProvider.GetFixCodeService(String filePath) 
at Microsoft.VisualStudio.Conversations.ErrorList.ErrorListEntryFixer.CanFix(ITableEntryHandle entryHandle) 
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint[T](Object errorSource, Func`1 call, T valueOnThrow) System.IO.Path.CheckInvalidPathChars System.IO.Path.GetExtension Microsoft.VisualStudio.Conversations.QuickActions.LanguageFixCodeServiceProvider.GetFixCodeService Microsoft.VisualStudio.Conversations.ErrorList.ErrorListEntryFixer.CanFix Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint Microsoft.VisualStudio.ErrorListPkg.FixerColumnDefinition.TryCreateColumnContent Microsoft.VisualStudio.Shell.TableControl.Implementation.TableEntryViewModel.GetEntryContent Microsoft.VisualStudio.Shell.TableControl.Implementation.TableEntryViewModel.get_Item System.RuntimeMethodHandle.InvokeMethod System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal System.Reflection.RuntimeMethodInfo.Invoke MS.Internal.Data.PropertyPathWorker.GetValue MS.Internal.Data.PropertyPathWorker.RawValue MS.Internal.Data.PropertyPathWorker.RawValue MS.Internal.Data.ClrBindingWorker.RawValue System.Windows.Data.BindingExpression.TransferValue System.Windows.Data.BindingExpression.Activate System.Windows.Data.BindingExpression.AttachToContext System.Windows.Data.BindingExpression.AttachOverride System.Windows.Data.BindingExpressionBase.OnAttach System.Windows.StyleHelper.GetInstanceValue System.Windows.StyleHelper.GetChildValueHelper System.Windows.StyleHelper.GetChildValue System.Windows.StyleHelper.GetValueFromTemplatedParent System.Windows.StyleHelper.ApplyTemplatedParentValue System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode System.Windows.FrameworkElementFactory.InstantiateTree System.Windows.StyleHelper.ApplyTemplateContent System.Windows.FrameworkTemplate.ApplyTemplateContent System.Windows.FrameworkElement.ApplyTemplate System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.GridViewRowPresenter.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.Border.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure MS.Internal.Helper.MeasureElementWithSingleChild System.Windows.Controls.ContentPresenter.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.Grid.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.Border.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.Control.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.Controls.VirtualizingStackPanel.MeasureChild System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl System.Windows.Controls.VirtualizingStackPanel.MeasureOverride System.Windows.FrameworkElement.MeasureCore System.Windows.UIElement.Measure System.Windows.ContextLayoutManager.UpdateLayout System.Windows.ContextLayoutManager.UpdateLayoutCallback System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks System.Windows.Media.MediaContext.RenderMessageHandlerCore System.Windows.Media.MediaContext.RenderMessageHandler System.Windows.Threading.ExceptionWrapper.InternalRealCall System.Windows.Threading.ExceptionWrapper.TryCatchWhen System.Windows.Threading.DispatcherOperation.InvokeImpl MS.Internal.CulturePreservingExecutionContext.CallbackWrapper System.Threading.ExecutionContext.RunInternal System.Threading.ExecutionContext.Run System.Threading.ExecutionContext.Run MS.Internal.CulturePreservingExecutionContext.Run System.Windows.Threading.DispatcherOperation.Invoke System.Windows.Threading.Dispatcher.ProcessQueue System.Windows.Threading.Dispatcher.WndProcHook MS.Win32.HwndWrapper.WndProc MS.Win32.HwndSubclass.DispatcherCallbackOperation System.Windows.Threading.ExceptionWrapper.InternalRealCall System.Windows.Threading.ExceptionWrapper.TryCatchWhen System.Windows.Threading.Dispatcher.LegacyInvokeImpl MS.Win32.HwndSubclass.SubclassWndProc </description> </entry>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions