I'm currently learning SlimDX, I want to load a Shader from tutorial which is named "triangle.fx" and it is in a folder called "FX",everything is in my solution. When I'm typing this line of code:

 using (var bytecode = ShaderBytecode.CompileFromFile(@"FX/triangle.fx", "PShader", "ps_4_0", ShaderFlags.None, EffectFlags.None))


I'm getting FileNotFoundException, and I don't know why because everything exists in my solution.

• I'm learning from tutorials from the homepage of Slimdx. Even when I'm downloading the sample solution from the website, I'm getting the same error :( – user78174 Jan 25 '16 at 17:14
• Are your files being copied to the build target? – RobStone Jan 26 '16 at 13:40
• @RobStone, well I've just added a folder called "FX", then I have created a file called triangle.txt (because VS doesnt have any function for creating them), and I have changed it's extension to *.fx – user78174 Jan 26 '16 at 18:43
• The FX folder is in the same directory as the built .exe? – RobStone Jan 26 '16 at 18:44
• @RobStone The .exe file is in bin/Debug/ And the FX folder is in the MySlimDXProject3 folder,same as bin folder – user78174 Jan 26 '16 at 18:50