I'm using Visual Studio Code with C# Microsoft Extension. I also have the following setting to format and fix all issues each time I save a file:
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true,
"source.sortMembers": true
},
I'm working on a .NET Core project and I don't know why Visual Studio Code is detecting that some usings are not being used which is wrong. Because of that, each time I save a file, the usings are being removed. I'm positive about this because the compiler let me know that I'm missing usings each time I run dotnet build.
Does anyone know how to solve this issue without changing the codeActionsOnSave setting that I have in place?
Software versions:
- C# Extension: v1.25.7
- .NET Core version: 7.0.202
I found a workaround that fixed my issues but compromises having
"source.fixAll"on c# files:settings.jsonfile. click here to learn how to do it