Skip to content

Commit 9bff4e6

Browse files
authored
Updating TFM for .NET Framework assembly from net472 to net481 (#14450)
* Updating TFM for .NET Framework assembly from net472 to net481 * Updating the dll path with correct TFM in the Package.
1 parent 5d71425 commit 9bff4e6

9 files changed

Lines changed: 26 additions & 25 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<Copyright>$(CopyrightNetFoundation)</Copyright>
1212
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1313
<PackageProjectUrl>https://github.com/dotnet/winforms</PackageProjectUrl>
14+
<NetFxTFM>net481</NetFxTFM>
1415
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
1516
<LangVersion Condition="'$(LangVersion)' == ''">preview</LangVersion>
1617
<ImplicitUsings>enable</ImplicitUsings>

pkg/Microsoft.Private.Windows.Core/Microsoft.Private.Windows.Core.Package.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-->
66

77
<PropertyGroup>
8-
<TargetFramework>net472</TargetFramework>
8+
<TargetFramework>$(NetFxTFM)</TargetFramework>
99

1010
<!-- Suppress some nuget warnings that are breaking our build until https://github.com/dotnet/arcade/issues/4337 is resolved -->
1111
<NoWarn>$(NoWarn);NU5100;NU5131;NU5128</NoWarn>
@@ -49,8 +49,8 @@
4949

5050
<PropertyGroup>
5151
<_SourceProjectName>Microsoft.Private.Windows.Core</_SourceProjectName>
52-
<_SourceRefDir>$(ArtifactsObjDir)$(_SourceProjectName)\$(Configuration)\net472\ref\</_SourceRefDir>
53-
<_SourceBinDir>$(ArtifactsBinDir)$(_SourceProjectName)\$(Configuration)\net472\</_SourceBinDir>
52+
<_SourceRefDir>$(ArtifactsObjDir)$(_SourceProjectName)\$(Configuration)\$(NetFxTFM)\ref\</_SourceRefDir>
53+
<_SourceBinDir>$(ArtifactsBinDir)$(_SourceProjectName)\$(Configuration)\$(NetFxTFM)\</_SourceBinDir>
5454

5555
<!-- Call custom target when creating the package -->
5656
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddPackageContent</TargetsForTfmSpecificContentInPackage>
@@ -59,8 +59,8 @@
5959
<!-- Include implementation and reference assemblies in the package -->
6060
<Target Name="AddPackageContent">
6161
<ItemGroup>
62-
<TfmSpecificPackageFile Include="$(_SourceBinDir)$(_SourceProjectName).dll" PackagePath="lib/net472" />
63-
<TfmSpecificPackageFile Include="$(_SourceRefDir)$(_SourceProjectName).dll" PackagePath="ref/net472" />
62+
<TfmSpecificPackageFile Include="$(_SourceBinDir)$(_SourceProjectName).dll" PackagePath="lib/$(NetFxTFM)" />
63+
<TfmSpecificPackageFile Include="$(_SourceRefDir)$(_SourceProjectName).dll" PackagePath="ref/$(NetFxTFM)" />
6464
</ItemGroup>
6565
</Target>
6666

src/System.Private.Windows.Core/src/Microsoft.Private.Windows.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<AssemblyName>Microsoft.Private.Windows.Core</AssemblyName>
5-
<TargetFrameworks>net472</TargetFrameworks>
5+
<TargetFrameworks>$(NetFxTFM)</TargetFrameworks>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<Nullable>enable</Nullable>
88
<!--

src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757

5858
<ItemGroup>
5959
<Reference Include="AxInterop.WMPLib">
60-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.WMPLib.dll</HintPath>
60+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.WMPLib.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Interop.WMPLib">
63-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.WMPLib.dll</HintPath>
63+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.WMPLib.dll</HintPath>
6464
</Reference>
6565
</ItemGroup>
6666

src/test/integration/WinformsControlsTest/WinformsControlsTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@
131131

132132
<ItemGroup>
133133
<Reference Include="AxInterop.WMPLib">
134-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.WMPLib.dll</HintPath>
134+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.WMPLib.dll</HintPath>
135135
</Reference>
136136
<Reference Include="Interop.WMPLib">
137-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.WMPLib.dll</HintPath>
137+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.WMPLib.dll</HintPath>
138138
</Reference>
139139
</ItemGroup>
140140

src/test/unit/.NET Framework/AxHosts/AxHosts.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net472</TargetFramework>
5+
<TargetFramework>$(NetFxTFM)</TargetFramework>
66
<Nullable>enable</Nullable>
77
<UseWindowsForms>true</UseWindowsForms>
88
<LangVersion>10</LangVersion>
@@ -95,4 +95,4 @@
9595
</ItemGroup>
9696
</Target>
9797

98-
</Project>
98+
</Project>

src/test/unit/.NET Framework/UnsupportedTypes/UnsupportedTypes.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>net472</TargetFramework>
5+
<TargetFramework>$(NetFxTFM)</TargetFramework>
66
<Nullable>disable</Nullable>
77
<UseWindowsForms>true</UseWindowsForms>
88
<LangVersion>preview</LangVersion>
@@ -18,4 +18,4 @@
1818
<IsTestUtilityProject>true</IsTestUtilityProject>
1919
</PropertyGroup>
2020

21-
</Project>
21+
</Project>

src/test/unit/System.Windows.Forms/ComDisabled/ComDisabled.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727

2828
<ItemGroup>
2929
<Reference Include="AxInterop.WMPLib">
30-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.WMPLib.dll</HintPath>
30+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.WMPLib.dll</HintPath>
3131
</Reference>
3232
<Reference Include="Interop.WMPLib">
33-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.WMPLib.dll</HintPath>
33+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.WMPLib.dll</HintPath>
3434
</Reference>
3535
</ItemGroup>
3636

3737
<ItemGroup>
3838
<Reference Include="AxInterop.SystemMonitor">
39-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.SystemMonitor.dll</HintPath>
39+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.SystemMonitor.dll</HintPath>
4040
</Reference>
4141
<Reference Include="Interop.SystemMonitor">
42-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.SystemMonitor.dll</HintPath>
42+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.SystemMonitor.dll</HintPath>
4343
</Reference>
4444
</ItemGroup>
4545

src/test/unit/System.Windows.Forms/System.Windows.Forms.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,34 @@
4747

4848
<ItemGroup>
4949
<Reference Include="AxInterop.WMPLib">
50-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.WMPLib.dll</HintPath>
50+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.WMPLib.dll</HintPath>
5151
</Reference>
5252
<Reference Include="Interop.WMPLib">
53-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.WMPLib.dll</HintPath>
53+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.WMPLib.dll</HintPath>
5454
</Reference>
5555
</ItemGroup>
5656

5757
<ItemGroup>
5858
<Reference Include="AxInterop.SystemMonitor">
59-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.SystemMonitor.dll</HintPath>
59+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.SystemMonitor.dll</HintPath>
6060
</Reference>
6161
<Reference Include="Interop.SystemMonitor">
62-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.SystemMonitor.dll</HintPath>
62+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.SystemMonitor.dll</HintPath>
6363
</Reference>
6464
</ItemGroup>
6565

6666
<ItemGroup>
6767
<Reference Include="AxInterop.SHDocVw">
68-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\AxInterop.SHDocVw.dll</HintPath>
68+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\AxInterop.SHDocVw.dll</HintPath>
6969
</Reference>
7070
<Reference Include="Interop.SHDocVw">
71-
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.SHDocVw.dll</HintPath>
71+
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\$(NetFxTFM)\Interop.SHDocVw.dll</HintPath>
7272
</Reference>
7373
</ItemGroup>
7474

7575
<ItemGroup>
7676
<Reference Include="UnsupportedTypes">
77-
<HintPath>$(ArtifactsBinDir)\UnsupportedTypes\$(Configuration)\net472\UnsupportedTypes.dll</HintPath>
77+
<HintPath>$(ArtifactsBinDir)\UnsupportedTypes\$(Configuration)\$(NetFxTFM)\UnsupportedTypes.dll</HintPath>
7878
</Reference>
7979
</ItemGroup>
8080

0 commit comments

Comments
 (0)