DirectX 11 Frank Luna
This is probably due to the encoding of your shader file. Make sure they're ASCII; you don't want a byte-order mark at the start, the compiler won't handle it well.
The error says there's an illegal character at Line 1 Col 1. It may be an "invisible" character due to text encoding.
Try: delete the line and retype it.
ninja'd
Yeah, I'm still using VS 2010 Express and creating a new text file produces one with a BOM-char. Probably applies to newer VS, too. I usually copy a working shader file from somewhere and use "Add Existing" in the Solution Explorer. If you already got some shader files added, you can use Copy-Paste in the Solution Explorer .
Edit: Disregard, Oberon_Command has a saner solution. Never occured to me :P
The problem might be an IDE setting, then. Try opening the file in a hex editor and looking at the first two bytes to make sure they aren't 0xFE 0xFF. If they are, open the file in Visual Studio again and go to File -> Advanced Save Options to change the encoding to US-ASCII. If that option isn't present, or if that doesn't work, try going File -> Save As, then instead of clicking on the "Save" button itself, click on the drop-down arrow beside it and select "Save with Encoding." That should allow you to change the encoding of the file.
Were there any other strange characters there? Did you try the "Save with Encoding" idea? If that doesn't work, you could try recreating the file from scratch in Notepad or some other text editor.
Maybe make sure your line endings use the Windows convention instead of the UNIX convention, and that you have a newline at the end of the file?
No. There's nothing I can do on my end that you cannot do yourself. Both of us have Visual Studio. Both of us have access to Notepad, hex editors and other text editors. I'm not going to fix the problem for you when you can fix it yourself and learn something by doing so. If you already tried everything I suggested, and it didn't work, then I am out of ideas (some of which came from google searching the error message, which I assume you did yourself before posting) and therefore can't fix it for you anyway.