Community.VisualStudio.Toolkit icon indicating copy to clipboard operation
Community.VisualStudio.Toolkit copied to clipboard

Error when removing unassigned files from solution folders in VS Experimental Instance with Demo Extension

Open Matt-17 opened this issue 1 year ago • 0 comments

Description

I encountered an error in Visual Studio when performing file operations within the Solution Explorer. Specifically, the error arises when I remove files that are not associated with any project but are added to solution folders. This minor issue seems to be triggered only when the demo extension is installed in my Visual Studio Experimental Instance.

Steps to Reproduce

  1. Open Visual Studio Experimental Instance with the demo extension installed.
  2. Add files to a solution folder without associating them with any project.
  3. Attempt to remove these files from the solution folder.

Expected Behavior

The files should be removed without any errors.

Actual Behavior

An error occurs, which seems to stem from a null reference exception. The specific line of code causing the issue is in TestExtensionPackage.cs at line 90:

  string info = string.Join(",", obj.ProjectItemRemoves.Select(x => $"{x.Project.Name}:{x.RemovedItemName}"));         

It appears that x.Project is null at this point, leading to the error when attempting to access its Name property.

Matt-17 avatar Nov 13 '23 11:11 Matt-17