ResourcesGenerator Task

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see ResourcesGenerator Task on docs.microsoft.com. The ResourcesGenerator task embeds one or more resources (.jpg, .ico, .bmp, XAML in binary format, and other extension types) into a .resources file.

ParameterDescription
OutputPathRequired String parameter.

Specifies the path of the output directory. If the path is not an absolute path, it is treated as a path that is relative to the root project directory.
OutputResourcesFileRequired ITaskItem[] output parameter.

Specifies the path and name of the generated .resources file. If the path is not an absolute path, the .resources file is generated relative to the root project directory.
ResourcesFilesRequired ITaskItem[] parameter.

Specifies one or more resources to embed in the generated .resources file.

The following example generates a .resources file with a single .bmp resource. The .bmp resource is generated to a directory that is relative to the project root directory.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
  <UsingTask   
    TaskName="Microsoft.Build.Tasks.Windows.ResourcesGenerator"   
    AssemblyFile="C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationBuildTasks.dll" />  
  <Target Name="ResourcesGeneratorTask">  
    <ResourcesGenerator  
      ResourceFiles="Resource1.bmp"  
      OutputPath="myresources"  
      OutputResourcesFile="myresources\my.resources" />  
  </Target>  
</Project>  

WPF MSBuild Reference
Task Reference
MSBuild Reference
Task Reference
Building a WPF Application (WPF)

Show: