Version Used
Compiler: 4.13.0-2.24565.3 (c267dc9)
.NET: 9.0.100
Visual Studio Code: 1.95.3, f1a4fb101478ce6ec82fe9627c43efbf9e98c813, x64
C# Extension: v2.57.28
C# Dev Kit Extension: v1.14.8
Steps to Reproduce
- Create or open a C# solution in Visual Studio Code (Visual Studio untested).
- Create two projects:
- Project 1:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
- Project 2:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="path/to/Project 1" />
</ItemGroup>
</Project>
- Add the following code wherever syntactically applicable in Project 1:
namespace Project1;
public class C;
namespace Project1.Extensions;
public static class CExtensions {
public static void M(this C c) { }
}
- Add the following code wherever syntactically applicable in Project 2:
using Project1;
namespace Project2;
class Repro {
void M(C c) {
c.M();
}
}
- Attempt to apply
Add import on c.M().
Expected Behavior
The fix is suggested.
Actual Behavior
It is not.