I suffered from the same problem. In my case, the reason for this was the Build Action configuration property. (Right-click on the configuration file> Properties> Build Action)
Build Action has been set to None. After I changed it to "Content", the problem was resolved. (I'm not sure if it was a “Visual Studio error” or “my click on an error”, which made it “No”).
source share