Skip to content

Commit 89e4aff

Browse files
authored
Include resources in command line arguments produced by csc in design-time build (#11949)
1 parent 3baee9b commit 89e4aff

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/Tasks/Microsoft.Common.CurrentVersion.targets

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,7 +3189,8 @@ Copyright (C) Microsoft Corporation. All rights reserved.
31893189
AssignTargetPaths;
31903190
SplitResourcesByCulture;
31913191
CreateManifestResourceNames;
3192-
CreateCustomManifestResourceNames
3192+
CreateCustomManifestResourceNames;
3193+
AssignEmbeddedResourceOutputPaths;
31933194
</PrepareResourceNamesDependsOn>
31943195
</PropertyGroup>
31953196

@@ -3247,6 +3248,17 @@ Copyright (C) Microsoft Corporation. All rights reserved.
32473248

32483249
</Target>
32493250

3251+
<!--
3252+
Sets OutputResource metadata on EmbeddedResource items. This metadata is used in design time build without running ResGen target.
3253+
-->
3254+
<Target Name="AssignEmbeddedResourceOutputPaths">
3255+
<ItemGroup>
3256+
<EmbeddedResource Condition="'%(EmbeddedResource.OutputResource)' == ''">
3257+
<OutputResource>$(IntermediateOutputPath)%(EmbeddedResource.ManifestResourceName).resources</OutputResource>
3258+
</EmbeddedResource>
3259+
</ItemGroup>
3260+
</Target>
3261+
32503262
<!--
32513263
============================================================
32523264
GetItemTargetPaths
@@ -3453,7 +3465,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
34533465
StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
34543466
StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
34553467
PublicClass="%(EmbeddedResource.PublicClass)"
3456-
OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
3468+
OutputResources="@(EmbeddedResource->'%(OutputResource)')"
34573469
Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' != 'CLR2'"
34583470
SdkToolsPath="$(ResgenToolPath)"
34593471
ExecuteAsTool="$(ResGenExecuteAsTool)"
@@ -3663,7 +3675,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
36633675
Create the _CoreCompileResourceInputs list of inputs to the CoreCompile target.
36643676
============================================================
36653677
-->
3666-
<Target Name="_GenerateCompileInputs">
3678+
<Target Name="_GenerateCompileInputs" DependsOnTargets="PrepareResourceNames">
36673679

36683680
<MSBuildInternalMessage
36693681
Condition="'@(ManifestResourceWithNoCulture)'!='' and '%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''"

0 commit comments

Comments
 (0)