title: Custom build action properties in a Visual Studio C# project
body: <p>In a Visual Studio C++ project I can define custom build actions and corresponding property rules (see <code>cl.xml</code> under the MSBuild folder). How can I create such a rule for a custom build action in a C# project? Under the MSBuild folder there's a the file <code>Microsoft.CSharp.CurrentVersion.targets</code> which references <code>CSharp.ProjectItemsSchema.xaml</code>, <code>CSharp.xaml</code> and <code>CSharp.BrowseObject.xaml</code> which looks exacltly like the definitions I need. Using procmon I can see that these files are not accessed at all. What's the correct way to define custom build actions?</p>
  
  <p>To clarify what I want to accomplish here's an example:</p>
  
  <ol>
  <li>I add an image file (.png) to the project</li>
  <li>I have a special image resource 'compiler' the transform the image (this compiler is defined using a msbuild target)</li>
  <li>I want to change properties of the image file (e.g. target resolution, format, etc.). In a C++ project I can open the file property dialog for this.
  These properties are saved as MSBuild item metadata and forwarded to the MSBuild target.</li>
  </ol>
  
  <p>The resulting project file would contain data like this:</p>
  
  <pre><code>&lt;ItemGroup&gt;
      &lt;MyImageContent Include="Image.png"&gt;
        &lt;OutputName&gt;MyImage.png&lt;/OutputName&gt;
        &lt;TargetResX&gt;512&lt;/TargetResX&gt;
        &lt;TargetResY&gt;256&lt;/TargetResY&gt;
      &lt;/MyImageContent&gt;
    &lt;/ItemGroup&gt;
  </code></pre>
  
  <p>This additional metadata can easily be used by a custom MSBuild target. So far I know how to do it.</p>
  
  <p>But: In a VC++ project this metadata can be easily edited in a property window provided by Visual Studio. The definition Visual Studio uses comes from a rules xml file similar to the cl.xml I mentioned. How can I accomplish this in a C# project?</p>