title: How to build shader effect (.fx) in csproj
body: <p>I'm trying to build pixel shader in a C# class library.</p>
  
  <p>I have added fx file to the project. Since I can't find any suitable build action I tried to manually edit csproj:</p>
  
  <pre><code>&lt;FxCompile Include="MyEffect.fx"&gt;
    &lt;ShaderType&gt;Pixel&lt;/ShaderType&gt;
  &lt;/FxCompile&gt;
  </code></pre>
  
  <p>but when I try to locate the ps file, I get <code>System.IO.IOException: Cannot locate resource 'MyEffect.ps'</code></p>
  
  <p>here is the code that throws error:</p>
  
  <pre><code> public class MyEffect : ShaderEffect
   {
     public MyEffect(){
       this.PixesShader = new Uri("pack://application:,,,/WpfControlLibrary1;component/MyEffect.ps");
     }
   }
  </code></pre>
  
  <p><strong>How to setup my project so that I can locate the compiled shader?</strong></p>
  
  <p>All the tutorials I have found are for C++ projects or deals with old tools like custom build task, but I think that is not required since VS2012.</p>
  
  <p><strong>EDIT:</strong>
  Visual Studio does compile .fx files only in C++ projects. In C# projects it does not work. It is mentioneded here: <a href="http://blogs.msdn.com/b/chuckw/archive/2012/05/07/hlsl-fxc-and-d3dcompile.aspx" rel="nofollow">http://blogs.msdn.com/b/chuckw/archive/2012/05/07/hlsl-fxc-and-d3dcompile.aspx</a></p>