Skip to content

Commit 5046d92

Browse files
committed
Move default RuntimeIdentifiers for cross-targeting to BeforeCommon
This resolves conflict with Microsoft.NuGet.targets imported on full framework MSBuild. Work is in progress to remove that import, but this decouples that from the change to allow desktop exe projects without explicit RID.
1 parent d1c2fd4 commit 5046d92

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.BeforeCommonCrossTargeting.targets

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ Copyright (c) .NET Foundation. All rights reserved.
1111
-->
1212
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1313

14+
<!--
15+
Nuget doesn't see or use runtime identifiers in restore that are only
16+
conditionally used in some inner builds.
17+
18+
However, in the case where we're building .NETFramework exe on Windows
19+
(see *.RuntimeIdentifierInference.targets for more information) in an inner
20+
build, we may implicitly use one of these RIDs and so we must ensure that restore
21+
includes them.
22+
-->
23+
<PropertyGroup Condition="'$(RuntimeIdentifiers)' == '' and '$(OS)' == 'Windows_NT'">
24+
<RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
25+
</PropertyGroup>
26+
1427
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultAssemblyInfo.targets" />
1528
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DefaultOutputPaths.targets" />
1629

src/Tasks/Microsoft.NET.Build.Tasks/buildCrossTargeting/Microsoft.NET.Sdk.targets

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,5 @@ Copyright (c) .NET Foundation. All rights reserved.
3030
<Target Name="Publish">
3131
<Error Text="The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, please specify the framework for the published application." />
3232
</Target>
33-
34-
<!--
35-
Nuget doesn't see or use runtime identifiers in restore that are only
36-
conditionally used in some inner builds.
37-
38-
However, in the case where we're building .NETFramework exe on Windows
39-
(see *.RuntimeIdentifierInference.targets for more information) in an inner
40-
build, we may implicitly use one of these RIDs and so we must ensure that restore
41-
includes them.
42-
-->
43-
<PropertyGroup Condition="'$(RuntimeIdentifiers)' == '' and '$(OS)' == 'Windows_NT'">
44-
<RuntimeIdentifiers>win7-x86;win7-x64</RuntimeIdentifiers>
45-
</PropertyGroup>
33+
4634
</Project>

0 commit comments

Comments
 (0)