I have had this issue many times, are you using v12+ VS 2022? For me I had to go to Tools > Options > Text Editor > C# > Advanced > Editor Help and check [] Enable all features in opened files from source generators.