GenerateResource Class

Definition

This class defines the "GenerateResource" MSBuild task, which enables using resource APIs to transform resource files.

This API supports the product infrastructure and is not intended to be used directly from your code.

public ref class GenerateResource sealed : Microsoft::Build::Tasks::TaskExtension
public ref class GenerateResource sealed : Microsoft::Build::Tasks::TaskExtension, Microsoft::Build::Framework::IIncrementalTask
[Microsoft.Build.Framework.RequiredRuntime("v2.0")]
public sealed class GenerateResource : Microsoft.Build.Tasks.TaskExtension
[Microsoft.Build.Framework.RequiredRuntime("v2.0")]
public sealed class GenerateResource : Microsoft.Build.Tasks.TaskExtension, Microsoft.Build.Framework.IIncrementalTask
public sealed class GenerateResource : Microsoft.Build.Tasks.TaskExtension
[<Microsoft.Build.Framework.RequiredRuntime("v2.0")>]
type GenerateResource = class
    inherit TaskExtension
[<Microsoft.Build.Framework.RequiredRuntime("v2.0")>]
type GenerateResource = class
    inherit TaskExtension
    interface IIncrementalTask
type GenerateResource = class
    inherit TaskExtension
Public NotInheritable Class GenerateResource
Inherits TaskExtension
Public NotInheritable Class GenerateResource
Inherits TaskExtension
Implements IIncrementalTask
Inheritance
GenerateResource
Attributes
Implements

Constructors

GenerateResource()

This API supports the product infrastructure and is not intended to be used directly from your code.

Simple public constructor.

Properties

AdditionalInputs

This API supports the product infrastructure and is not intended to be used directly from your code.

Additional inputs to the dependency checking done by this task. For example, the project and targets files typically should be inputs, so that if they are updated, all resources are regenerated.

BuildEngine

The build engine automatically sets this property to allow tasks to call back into it.

(Inherited from Task)
BuildEngine2

The build engine automatically sets this property to allow tasks to call back into it. This is a convenience property so that task authors inheriting from this class do not have to cast the value from IBuildEngine to IBuildEngine2.

(Inherited from Task)
BuildEngine3

Retrieves the IBuildEngine3 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine4

Retrieves the IBuildEngine4 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine5

Retrieves the IBuildEngine5 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine6

Retrieves the IBuildEngine6 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine7

Retrieves the IBuildEngine7 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine8

Retrieves the IBuildEngine8 version of the build engine interface provided by the host.

(Inherited from Task)
BuildEngine9

Retrieves the IBuildEngine9 version of the build engine interface provided by the host.

(Inherited from Task)
EnvironmentVariables

This API supports the product infrastructure and is not intended to be used directly from your code.

Array of equals-separated pairs of environment variables that should be passed to the spawned resgen.exe, in addition to (or selectively overriding) the regular environment block. These aren't currently used when resgen is run in-process.

ExcludedInputPaths

This API supports the product infrastructure and is not intended to be used directly from your code.

That set of paths from which tracked inputs will be ignored during Up to date checking

ExecuteAsTool

This API supports the product infrastructure and is not intended to be used directly from your code.

Property to allow multitargeting of ResolveComReferences: If true, tlbimp.exe and aximp.exe from the appropriate target framework will be run out-of-proc to generate the necessary wrapper assemblies.

ExtractResWFiles

This API supports the product infrastructure and is not intended to be used directly from your code.

Whether this rule is generating .resources files or extracting .ResW files from assemblies. Requires some additional input filtering.

FailIfNotIncremental
FilesWritten

This API supports the product infrastructure and is not intended to be used directly from your code.

Storage for names of all files written to disk. This is part of the implementation for Clean, and contains the OutputResources items and the StateFile item. Includes any output files that were already up to date, but not any output files that failed to be written due to an error.

HelpKeywordPrefix

Gets or sets the prefix used to compose help keywords from string resource names. If a task does not have help keywords associated with its messages, it can ignore this property or set it to null. If the prefix is set to an empty string, then string resource names will be used verbatim as help keywords. For an example of how this prefix is used, see the TaskLoggingHelper.LogErrorWithCodeFromResources(string, object[]) method.

(Inherited from Task)
HostObject

The build engine sets this property if the host IDE has associated a host object with this particular task.

(Inherited from Task)
Log

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets an instance of a TaskLoggingHelperExtension class containing task logging methods.

(Inherited from TaskExtension)
MinimalRebuildFromTracking

This API supports the product infrastructure and is not intended to be used directly from your code.

Property used to set whether tracked incremental build will be used. If true, incremental build is turned on; otherwise, a rebuild will be forced.

NeverLockTypeAssemblies

This API supports the product infrastructure and is not intended to be used directly from your code.

(default = false) When true, a new AppDomain is always created to evaluate the .resx files. When false, a new AppDomain is created only when it looks like a user's assembly is referenced by the .resx.

OutputDirectory

This API supports the product infrastructure and is not intended to be used directly from your code.

Where to extract ResW files. (Could be the intermediate directory.)

OutputResources

This API supports the product infrastructure and is not intended to be used directly from your code.

The name(s) of the resource file to create. If the user does not specify this attribute, the task will append a .resources extension to each input filename argument and write the file to the directory that contains the input file. Includes any output files that were already up to date, but not any output files that failed to be written due to an error.

PublicClass

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies whether the strongly typed class should be created public (with public methods) instead of the default internal. Analogous to resgen.exe's /publicClass switch.

References

This API supports the product infrastructure and is not intended to be used directly from your code.

Resolves types in ResX files (XML resources) for Strongly Typed Resources

SdkToolsPath

This API supports the product infrastructure and is not intended to be used directly from your code.

Even though the generate resource task will do the processing in process, a logging message is still generated. This logging message will include the path to the windows SDK. Since the targets now will pass in the Windows SDK path we should use this for logging.

Sources

This API supports the product infrastructure and is not intended to be used directly from your code.

The names of the items to be converted. The extension must be one of the following: .txt, .resx or .resources.

StateFile

This API supports the product infrastructure and is not intended to be used directly from your code.

This is the path/name of the file containing the dependency cache

StronglyTypedClassName

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies the class name for the strongly typed resource class. If left blank, the base name of the resource file is used.

StronglyTypedFileName

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies the filename for the source file. If left blank, the name of the class is used as the base filename, with the extension dependent on the language.

StronglyTypedLanguage

This API supports the product infrastructure and is not intended to be used directly from your code.

The language to use when generating the class source for the strongly typed resource. This parameter must match exactly one of the languages used by the CodeDomProvider.

StronglyTypedManifestPrefix

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies the resource namespace or manifest prefix to use in the generated class source for the strongly typed resource.

StronglyTypedNamespace

This API supports the product infrastructure and is not intended to be used directly from your code.

Specifies the namespace to use for the generated class source for the strongly typed resource. If left blank, no namespace is used.

TaskResources

Gets or sets the task's culture-specific resources. Derived classes should register their resources either during construction, or via this property, if they have localized strings.

(Inherited from Task)
TLogReadFiles

This API supports the product infrastructure and is not intended to be used directly from your code.

Names of the read tracking logs.

TLogWriteFiles

This API supports the product infrastructure and is not intended to be used directly from your code.

Names of the write tracking logs.

ToolArchitecture

This API supports the product infrastructure and is not intended to be used directly from your code.

Microsoft.Build.Utilities.ExecutableType of ResGen.exe. Used to determine whether or not Tracker.exe needs to be used to spawn ResGen.exe. If empty, uses a heuristic to determine a default architecture.

TrackerFrameworkPath

This API supports the product infrastructure and is not intended to be used directly from your code.

Path to the appropriate .NET Framework location that contains FileTracker.dll. If set, the user takes responsibility for making sure that the bitness of the FileTracker.dll that they pass matches the bitness of the ResGen.exe that they intend to use. If not set, the task decides the appropriate location based on the current .NET Framework version.

TrackerLogDirectory

This API supports the product infrastructure and is not intended to be used directly from your code.

Intermediate directory into which the tracking logs from running this task will be placed.

TrackerSdkPath

This API supports the product infrastructure and is not intended to be used directly from your code.

Path to the appropriate Windows SDK location that contains Tracker.exe. If set, the user takes responsibility for making sure that the bitness of the Tracker.exe that they pass matches the bitness of the ResGen.exe that they intend to use. If not set, the task decides the appropriate location based on the current Windows SDK.

TrackFileAccess

This API supports the product infrastructure and is not intended to be used directly from your code.

True if we should be tracking file access patterns - necessary for incremental build support.

UsePreserializedResources

Indicates whether resources should be passed through in their current serialization format. .NET Core-targeted assemblies should use this; it's the only way to support non-string resources with MSBuild running on .NET Core.

UseSourcePath

This API supports the product infrastructure and is not intended to be used directly from your code.

Indicates whether the resource reader should use the source file's directory to resolve relative file paths.

WarnOnBinaryFormatterUse

Methods

Execute()

This API supports the product infrastructure and is not intended to be used directly from your code.

This is the main entry point for the GenerateResource task.

Applies to