Skip to content

Commit 7ef0756

Browse files
committed
5th 10
1 parent 0b2f505 commit 7ef0756

10 files changed

+81
-80
lines changed

docs/msbuild/generateresource-task.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ manager: douge
2121
ms.workload:
2222
- "multiple"
2323
---
24-
# GenerateResource Task
25-
Converts between .txt and .resx (XML-based resource format) files and common language runtime binary .resources files that can be embedded in a runtime binary executable or compiled into satellite assemblies. This task is typically used to convert .txt or .resx files to .resource files. The `GenerateResource` task is functionally similar to [resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator).
24+
# GenerateResource task
25+
Converts between *.txt* and *.resx* (XML-based resource format) files and common language runtime binary *.resources* files that can be embedded in a runtime binary executable or compiled into satellite assemblies. This task is typically used to convert *.txt* or *.resx* files to *.resources* files. The `GenerateResource` task is functionally similar to [resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator).
2626

2727
## Parameters
2828
The following table describes the parameters of the `GenerateResource` task.
@@ -36,35 +36,35 @@ Converts between .txt and .resx (XML-based resource format) files and common lan
3636
|`FilesWritten`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` output parameter.<br /><br /> Contains the names of all files written to disk. This includes the cache file, if any. This parameter is useful for implementations of Clean.|
3737
|`MinimalRebuildFromTracking`|Optional `Boolean` parameter.<br /><br /> Gets or sets a switch that specifies whether tracked incremental build will be used. If `true`, incremental build is turned on; otherwise, a rebuild will be forced.|
3838
|`NeverLockTypeAssemblies`|Optional `Boolean` parameter.<br /><br /> Gets or sets a Boolean value that specifies whether to create a new [AppDomain](/dotnet/api/system.appdomain) to evaluate the resources (.resx) files (true) or to create a new [AppDomain](/dotnet/api/system.appdomain) only when the resources files reference a user's assembly (false).|
39-
|`OutputResources`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` output parameter.<br /><br /> Specifies the name of the generated files, such as .resources files. If you do not specify a name, the name of the matching input file is used and the .resources file that is created is placed in the directory that contains the input file.|
39+
|`OutputResources`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` output parameter.<br /><br /> Specifies the name of the generated files, such as *.resources* files. If you do not specify a name, the name of the matching input file is used and the *.resources* file that is created is placed in the directory that contains the input file.|
4040
|`PublicClass`|Optional `Boolean` parameter.<br /><br /> If `true`, creates a strongly typed resource class as a public class.|
41-
|`References`|Optional `String[]` parameter.<br /><br /> References to load types in .resx files from. Resx file data elements may have a .NET type. When the .resx file is read, this must be resolved. Typically, it is resolved successfully by using standard type loading rules. If you provide assemblies in `References`, they take precedence.<br /><br /> This parameter is not required for strongly typed resources.|
41+
|`References`|Optional `String[]` parameter.<br /><br /> References to load types in *.resx* files from. *.resx* file data elements may have a .NET type. When the *.resx* file is read, this must be resolved. Typically, it is resolved successfully by using standard type loading rules. If you provide assemblies in `References`, they take precedence.<br /><br /> This parameter is not required for strongly typed resources.|
4242
|`SdkToolsPath`|Optional `String` parameter.<br /><br /> Specifies the path to the SDK tools, such as resgen.exe.|
43-
|`Sources`|Required <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Specifies the items to convert. Items passed to this parameter must have one of the following file extensions:<br /><br /> - `.txt`: Specifies the extension for a text file to convert. Text files can only contain string resources.<br />- `.resx`: Specifies the extension for an XML-based resource file to convert.<br />- `.restext`: Specifies the same format as .txt. This different extension is useful if you want to clearly distinguish source files that contain resources from other source files in your build process.<br />- `.resources`: Specifies the extension for a resource file to convert.|
44-
|`StateFile`|Optional <xref:Microsoft.Build.Framework.ITaskItem> parameter.<br /><br /> Specifies the path to an optional cache file that is used to speed up dependency checking of links in .resx input files.|
43+
|`Sources`|Required <xref:Microsoft.Build.Framework.ITaskItem>`[]` parameter.<br /><br /> Specifies the items to convert. Items passed to this parameter must have one of the following file extensions:<br /><br /> - *.txt*: Specifies the extension for a text file to convert. Text files can only contain string resources.<br />- *.resx*: Specifies the extension for an XML-based resource file to convert.<br />- *.restext*: Specifies the same format as *.txt*. This different extension is useful if you want to clearly distinguish source files that contain resources from other source files in your build process.<br />- *.resources*: Specifies the extension for a resource file to convert.|
44+
|`StateFile`|Optional <xref:Microsoft.Build.Framework.ITaskItem> parameter.<br /><br /> Specifies the path to an optional cache file that is used to speed up dependency checking of links in *.resx* input files.|
4545
|`StronglyTypedClassName`|Optional `String` parameter.<br /><br /> Specifies the class name for the strongly typed resource class. If this parameter is not specified, the base name of the resource file is used.|
46-
|`StronglyTypedFilename`|Optional <xref:Microsoft.Build.Framework.ITaskItem> parameter.<br /><br /> Specifies the filename for the source file. If this parameter is not specified, the name of the class is used as the base filename, with the extension dependent on the language. For example: `MyClass.cs`.|
46+
|`StronglyTypedFilename`|Optional <xref:Microsoft.Build.Framework.ITaskItem> parameter.<br /><br /> Specifies the filename for the source file. If this parameter is not specified, the name of the class is used as the base filename, with the extension dependent on the language. For example: *MyClass.cs*.|
4747
|`StronglyTypedLanguage`|Optional `String` parameter.<br /><br /> Specifies 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. For example: `VB` or `C#`.<br /><br /> By passing a value to this parameter, you instruct the task to generate strongly typed resources.|
4848
|`StronglyTypedManifestPrefix`|Optional `String` parameter.<br /><br /> Specifies the resource namespace or manifest prefix to use in the generated class source for the strongly typed resource.|
4949
|`StronglyTypedNamespace`|Optional `String` parameter.<br /><br /> Specifies the namespace to use for the generated class source for the strongly typed resource. If this parameter is not specified, any strongly typed resources are in the global namespace.|
5050
|`TLogReadFiles`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` read-only parameter.<br /><br /> Gets an array of items that represent the read tracking logs.|
5151
|`TLogWriteFiles`|Optional <xref:Microsoft.Build.Framework.ITaskItem>`[]` read-only parameter.<br /><br /> Gets an array of items that represent the write tracking logs.|
5252
|`ToolArchitecture`|Optional <xref:System.String?displayProperty=fullName> parameter.<br /><br /> Used to determine whether or not Tracker.exe needs to be used to spawn ResGen.exe.<br /><br /> Should be parsable to a member of the <xref:Microsoft.Build.Utilities.ExecutableType> enumeration. If `String.Empty`, uses a heuristic to determine a default architecture. Should be parsable to a member of the Microsoft.Build.Utilities.ExecutableType enumeration.|
53-
|`TrackerFrameworkPath`|Optional `String` parameter.<br /><br /> Specifies the path to the appropriate .NET Framework location that contains FileTracker.dll.<br /><br /> 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.|
53+
|`TrackerFrameworkPath`|Optional `String` parameter.<br /><br /> Specifies the path to the appropriate .NET Framework location that contains *FileTracker.dll*.<br /><br /> 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.|
5454
|`TrackerLogDirectory`|Optional `String` parameter.<br /><br /> Specifies the intermediate directory into which the tracking logs from running this task will be placed.|
55-
|`TrackerSdkPath`|Optional `String` parameter.<br /><br /> Specifies the path to the appropriate Windows SDK location that contains Tracker.exe.<br /><br /> 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.|
55+
|`TrackerSdkPath`|Optional `String` parameter.<br /><br /> Specifies the path to the appropriate Windows SDK location that contains *Tracker.exe*.<br /><br /> 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.|
5656
|`TrackFileAccess`|Optional <xref:System.Boolean> parameter.<br /><br /> If true, the directory of the input file is used for resolving relative file paths.|
5757
|`UseSourcePath`|Optional `Boolean` parameter.<br /><br /> If `true`, specifies that the input file's directory is to be used for resolving relative file paths.|
5858

5959
## Remarks
60-
Because .resx files may contain links to other resource files, it is not sufficient to simply compare .resx and .resource file timestamps to see if the outputs are up-to-date. Instead, the `GenerateResource` task follows the links in the .resx files and checks the timestamps of the linked files as well. This means that you should not generally use `Inputs` and `Outputs` attributes on the target containing the `GenerateResource` task, as this may cause it to be skipped when it should actually run.
60+
Because *.resx* files may contain links to other resource files, it is not sufficient to simply compare *.resx* and *.resources* file timestamps to see if the outputs are up-to-date. Instead, the `GenerateResource` task follows the links in the *.resx* files and checks the timestamps of the linked files as well. This means that you should not generally use `Inputs` and `Outputs` attributes on the target containing the `GenerateResource` task, as this may cause it to be skipped when it should actually run.
6161

62-
In addition to the parameters listed above, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension Base Class](../msbuild/taskextension-base-class.md).
62+
In addition to the parameters listed above, this task inherits parameters from the <xref:Microsoft.Build.Tasks.TaskExtension> class, which itself inherits from the <xref:Microsoft.Build.Utilities.Task> class. For a list of these additional parameters and their descriptions, see [TaskExtension base class](../msbuild/taskextension-base-class.md).
6363

6464
When using MSBuild 4.0 to target .NET 3.5 projects, the build may fail on x86 resources. To work around this problem, you can build the target as an AnyCPU assembly.
6565

6666
## Example
67-
The following example uses the `GenerateResource` task to generate .resources files from the files specified by the `Resx` item collection.
67+
The following example uses the `GenerateResource` task to generate *.resources* files from the files specified by the `Resx` item collection.
6868

6969
```xml
7070
<GenerateResource
@@ -78,14 +78,14 @@ Converts between .txt and .resx (XML-based resource format) files and common lan
7878

7979
The `GenerateResource` task uses the \<LogicalName> metadata of an \<EmbeddedResource> item to name the resource that is embedded in an assembly.
8080

81-
Assuming that the assembly is named myAssembly, the following code generates an embedded resource named someQualifier.someResource.resources:
81+
Assuming that the assembly is named myAssembly, the following code generates an embedded resource named *someQualifier.someResource.resources*:
8282

8383
```xml
8484
<ItemGroup>   <EmbeddedResource Include="myResource.resx">       <LogicalName>someQualifier.someResource.resources</LogicalName>   </EmbeddedResource></ItemGroup>
8585
```
8686

87-
Without the \<LogicalName> metadata, the resource would be named myAssembly.myResource.resources. This example applies only to the Visual Basic and Visual C# build process.
87+
Without the \<LogicalName> metadata, the resource would be named *myAssembly.myResource.resources*. This example applies only to the Visual Basic and Visual C# build process.
8888

89-
## See Also
89+
## See also
9090
[Tasks](../msbuild/msbuild-tasks.md)
91-
[Task Reference](../msbuild/msbuild-task-reference.md)
91+
[Task reference](../msbuild/msbuild-task-reference.md)

docs/msbuild/generatetemporarytargetassembly-task.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ manager: douge
2121
ms.workload:
2222
- "multiple"
2323
---
24-
# GenerateTemporaryTargetAssembly Task
24+
# GenerateTemporaryTargetAssembly task
2525
The <xref:Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly> task generates an assembly if at least one [!INCLUDE[TLA#tla_xaml](../msbuild/includes/tlasharptla_xaml_md.md)] page in a project references a type that is declared locally in that project. The generated assembly is removed after the build process is completed, or if the build process fails.
2626

27-
## Task Parameters
27+
## Task parameters
2828

2929
|Parameter|Description|
3030
|---------------|-----------------|
31-
|`AssemblyName`|Required **String** parameter.<br /><br /> Specifies the short name of the assembly that is generated for a project and is also the name of the target assembly that is temporarily generated. For example, if a project generates a [!INCLUDE[TLA#tla_mswin](../code-quality/includes/tlasharptla_mswin_md.md)] executable whose name is **WinExeAssembly.exe**, the **AssemblyName** parameter has a value of **WinExeAssembly**.|
31+
|`AssemblyName`|Required **String** parameter.<br /><br /> Specifies the short name of the assembly that is generated for a project and is also the name of the target assembly that is temporarily generated. For example, if a project generates a [!INCLUDE[TLA#tla_mswin](../code-quality/includes/tlasharptla_mswin_md.md)] executable whose name is *WinExeAssembly.exe*, the **AssemblyName** parameter has a value of **WinExeAssembly**.|
3232
|`CompileTargetName`|Required **String** parameter.<br /><br /> Specifies the name of the [!INCLUDE[TLA#tla_msbuild](../msbuild/includes/tlasharptla_msbuild_md.md)] target that is used to generate assemblies from source code files. The typical value for **CompileTargetName** is **CoreCompile**.|
3333
|`CompileTypeName`|Required **String** parameter.<br /><br /> Specifies the type of compilation that is performed by the target that is specified by the **CompileTargetName** parameter. For the **CoreCompile** target, this value is **Compile**.|
3434
|`CurrentProject`|Required **String** parameter.<br /><br /> Specifies the full path of the [!INCLUDE[TLA2#tla_msbuild](../msbuild/includes/tla2sharptla_msbuild_md.md)] project file for the project that requires a temporary target assembly.|
3535
|`GeneratedCodeFiles`|Optional **ITaskItem[]** parameter.<br /><br /> Specifies the list of language-specific managed code files that were generated by the [MarkupCompilePass1](../msbuild/markupcompilepass1-task.md) task.|
3636
|`IntermediateOutputPath`|Required **String** parameter.<br /><br /> Specifies the directory that the temporary target assembly is generated to.|
37-
|`MSBuildBinPath`|Required **String** parameter.<br /><br /> Specifies the location of **MSBuild.exe**, which is required to compile the temporary target assembly.|
37+
|`MSBuildBinPath`|Required **String** parameter.<br /><br /> Specifies the location of *MSBuild.exe*, which is required to compile the temporary target assembly.|
3838
|`ReferencePath`|Optional **ITaskItem[]** parameter.<br /><br /> Specifies a list of assemblies, by path and file name, that are referenced by the types that are compiled into the temporary target assembly.|
3939
|`ReferencePathTypeName`|Required **String** parameter.<br /><br /> Specifies the parameter that is used by the compilation target (**CompileTargetName**) parameter that specifies the list of assembly references (**ReferencePath**). The appropriate value is **ReferencePath**.|
4040

@@ -44,7 +44,7 @@ The <xref:Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly> task ge
4444
Instead, **MarkupCompilePass1** defers the conversion of [!INCLUDE[TLA2#tla_xaml](../msbuild/includes/tla2sharptla_xaml_md.md)] files that contain references to types in the same project to a second markup compilation pass, which is executed by the [MarkupCompilePass2](../msbuild/markupcompilepass2-task.md). Before **MarkupCompilePass2** is executed, a temporary assembly is generated. This assembly contains the types that are used by the [!INCLUDE[TLA2#tla_xaml](../msbuild/includes/tla2sharptla_xaml_md.md)] files whose markup compilation pass was deferred. A reference to the generated assembly is provided to **MarkupCompilePass2** when it runs to allow the deferred compilation [!INCLUDE[TLA2#tla_xaml](../msbuild/includes/tla2sharptla_xaml_md.md)] files to be converted to binary format.
4545

4646
## Example
47-
The following example generates a temporary assembly because `Page1.xaml` contains a reference to a type that is in the same project.
47+
The following example generates a temporary assembly because *Page1.xaml* contains a reference to a type that is in the same project.
4848

4949
```xml
5050
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -66,10 +66,10 @@ The <xref:Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly> task ge
6666
</Project>
6767
```
6868

69-
## See Also
70-
[WPF MSBuild Reference](../msbuild/wpf-msbuild-reference.md)
71-
[Task Reference](../msbuild/wpf-msbuild-task-reference.md)
72-
[MSBuild Reference](../msbuild/msbuild-reference.md)
73-
[Task Reference](../msbuild/msbuild-task-reference.md)
74-
[Building a WPF Application (WPF)](/dotnet/framework/wpf/app-development/building-a-wpf-application-wpf)
75-
[WPF XAML Browser Applications Overview](/dotnet/framework/wpf/app-development/wpf-xaml-browser-applications-overview)
69+
## See also
70+
[WPF MSBuild reference](../msbuild/wpf-msbuild-reference.md)
71+
[Task reference](../msbuild/wpf-msbuild-task-reference.md)
72+
[MSBuild reference](../msbuild/msbuild-reference.md)
73+
[Task reference](../msbuild/msbuild-task-reference.md)
74+
[Building a WPF application (WPF)](/dotnet/framework/wpf/app-development/building-a-wpf-application-wpf)
75+
[WPF XAML browser applications overview](/dotnet/framework/wpf/app-development/wpf-xaml-browser-applications-overview)

0 commit comments

Comments
 (0)