Skip to content

Commit 65ed034

Browse files
authored
Template should import Microsoft.Cpp.Default.props before setting ReactNativeWindowsDir (#16146)
* Template should import Microsoft.Cpp.Default.props before setting ReactNativeWindowsDir * Change files
1 parent ffd9c9c commit 65ed034

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Template should import Microsoft.Cpp.Default.props before setting ReactNativeWindowsDir",
4+
"packageName": "react-native-windows",
5+
"email": "30809111+acoates-ms@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/template/cpp-lib/proj/MyLib.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<ApplicationType>Windows Store</ApplicationType>
1616
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
1717
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1819
<PropertyGroup Label="ReactNativeWindowsProps">
1920
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
2021
</PropertyGroup>
@@ -23,7 +24,6 @@
2324
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.22621.0</WindowsTargetPlatformVersion>
2425
<WindowsTargetPlatformMinVersion Condition=" '$(WindowsTargetPlatformMinVersion)' == '' ">10.0.17763.0</WindowsTargetPlatformMinVersion>
2526
</PropertyGroup>
26-
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2727
<ItemGroup Label="ProjectConfigurations">
2828
<ProjectConfiguration Include="Debug|ARM64">
2929
<Configuration>Debug</Configuration>

vnext/templates/cpp-app/windows/MyApp/MyApp.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
1717
<AppxPackage>false</AppxPackage>
1818
</PropertyGroup>
19+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1920
<PropertyGroup Label="ReactNativeWindowsProps">
2021
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
2122
</PropertyGroup>
2223
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" />
23-
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2424
<ItemGroup Label="ProjectConfigurations">
2525
<ProjectConfiguration Include="Debug|Win32">
2626
<Configuration>Debug</Configuration>

vnext/templates/cpp-lib/windows/MyLib/MyLib.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
1515
<AppxPackage>false</AppxPackage>
1616
</PropertyGroup>
17+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1718
<PropertyGroup Label="ReactNativeWindowsProps">
1819
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
1920
<RunAutolinkCheck>false</RunAutolinkCheck>
2021
</PropertyGroup>
2122
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" />
22-
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2323
<ItemGroup Label="ProjectConfigurations">
2424
<ProjectConfiguration Include="Debug|Win32">
2525
<Configuration>Debug</Configuration>

0 commit comments

Comments
 (0)