In my case everything worked and compiled fine but I had strange errors. It turned out that VS doesn’t understand .shader format and I had to install shaderlabVS extension.

In my case everything worked and compiled fine but I had strange errors. It turned out that VS doesn’t understand .shader format and I had to install shaderlabVS extension.

Reimporting the shader or deleting library folder didn’t work for me. In my case one of the shaders files (UnityStandardUtils.cginc) was corrupted and that’s why Unity couldn’t access it. I couldn’t delete it or move it out of the folder because it was corrupted due to the issue with my disc C. I had to scan my disc C and then I was able to delete this file. Then I found the exact same file in the same folder of the different Unity version and just copied and pasted this file into my folder. This fixed the issue.
If reimporting the shader doesn’t work for you. Check if you don’t have corrupted files in your shaders folder. You will now it is corrupted if you cant move it outside of the folder. It will tell you that there is an error because file is corrupted.
Consider checking whether the case of each character in the filename of source include shader is consistent with that in the file name in the include code.
In my case, the include code was:
#include “Test.cginc”
But I checked the file of the orginal cginc, it was just there and its filename was test.cginc.
Then I suddenly remembered that my project was located on an ext4 partition which is a case-sensitive filesystem. Renaming the cginc to Test.cginc worked like a charm.