I have a C# project that used SharpDX 2.5.0 and everything was working fine. I moved to the newest stable release of SharpDX, 2.6.2. My project compile fine but fails at runtime because it cannot compile the shaders. I'm using this line of code :
var vertexShaderByteCode = ShaderBytecode.CompileFromFile(ShaderFileName, "Base_VS", "vs_4_0");
No matter what the actual content of the shader file is, it fails with the following error :
path/to/my/shader.hlsl(1,1): error X3000: Illegal character in shader file
I thought it was related to the UTF-8 encoding of the file, but trying various encoding did not solve the problem. Has anyone else encountered a similar problem or has a suggestion ?
I finally found a solution. In case someone encounters the same situation, here is the workaround I found :