Here's how to reproduce (VS2010):
- Open project
- Close all open files
- Open shader file (in my case it was an .fx file)
- Close Visual Studio
- Open project again
Now the shader file should be open but without any syntax highlighting. Closing the file and reopening it makes it work again.