From ee017d221df5b9c2e4e8d03cf9492b47c47dabc5 Mon Sep 17 00:00:00 2001
From: Mike Crider <45052236+codendone@users.noreply.github.com>
Date: Thu, 19 Dec 2024 21:56:35 -0800
Subject: [PATCH] App-configurable compatibility options implementation:
CompatibilityOptions (#4976)
---
BuildAll.ps1 | 5 +
WindowsAppRuntime.sln | 70 ++++++++
...dowsAppSDK-SetupBuildEnvironment-Steps.yml | 8 +
build/CopyFilesToStagingDir.ps1 | 4 +
build/NuSpecs/AppxManifest.xml | 3 +
...t.WindowsAppSDK.AutoInitializer.CS.targets | 19 ++
...indowsAppSDK.AutoInitializerCommon.targets | 16 ++
...ndowsAppSDK.CompatibilitySetter.CS.targets | 64 +++++++
...Microsoft.WindowsAppSDK.Foundation.targets | 5 +
...ppSDK-Nuget-Native.AutoInitializer.targets | 23 +++
...K-Nuget-Native.CompatibilitySetter.targets | 73 ++++++++
.../WindowsAppSDK-Nuget-Native.targets | 5 +
build/VersionInfo/AssemblyInfo.h | 14 ++
build/VersionInfo/GenerateVersionInfo.ps1 | 22 ++-
dev/Common/Common.vcxitems | 6 +-
...nalVelocityFeatures-CompatibilityOptions.h | 32 ++++
...lVelocityFeatures-CompatibilityOptions.xml | 16 ++
.../WindowsAppRuntimeAutoInitializer.cpp | 59 ++++++
.../WindowsAppRuntimeAutoInitializer.cs | 35 ++++
.../CompatibilityOptions.cpp | 64 +++++++
.../CompatibilityOptions.h | 34 ++++
.../CompatibilityOptions.idl | 53 ++++++
.../CompatibilityOptions.vcxitems | 32 ++++
.../DeploymentManagerAutoInitializer.cpp | 13 +-
.../DeploymentManagerAutoInitializer.cs | 2 +-
.../UndockedRegFreeWinRT-AutoInitializer.cpp | 6 +-
.../UndockedRegFreeWinRT-AutoInitializer.cs | 2 +-
.../MddBootstrapAutoInitializer.cpp | 14 +-
.../MddBootstrapAutoInitializer.cs | 2 +-
.../WindowsAppRuntime_DLL.vcxproj | 1 +
docs/Coding-Guidelines/GettingStarted.md | 4 +-
.../CompatibilityTests/CompatibilityTests.cpp | 142 +++++++++++++++
.../CompatibilityTests.testdef | 11 ++
.../CompatibilityTests.vcxproj | 152 ++++++++++++++++
.../CompatibilityTests.vcxproj.filters | 36 ++++
.../CompatibilityTests/packages.config | 6 +
test/Compatibility/CompatibilityTests/pch.cpp | 8 +
test/Compatibility/CompatibilityTests/pch.h | 24 +++
.../Test_CompatibilitySetter_CPP.vcxproj | 169 ++++++++++++++++++
...st_CompatibilitySetter_CPP.vcxproj.filters | 17 ++
.../Test_CompatibilitySetter_CPP/main.cpp | 21 +++
.../Test_CompatibilitySetter_CPP/pch.cpp | 8 +
.../Test_CompatibilitySetter_CPP/pch.h | 24 +++
.../Test_CompatibilitySetter_CS/Program.cs | 19 ++
.../Test_CompatibilitySetter_CS.csproj | 33 ++++
...tManagerAutoInitialize_CPP_Default.vcxproj | 6 +
...AutoInitialize_CPP_Options_Default.vcxproj | 6 +
...AutoInitialize_CPP_Options_Defined.vcxproj | 6 +
...gerAutoInitialize_CPP_Options_None.vcxproj | 6 +
...entManagerAutoInitialize_CS_Default.csproj | 5 +
...erAutoInitialize_CS_Options_Default.csproj | 5 +
...erAutoInitialize_CS_Options_Defined.csproj | 17 ++
...nagerAutoInitialize_CS_Options_None.csproj | 5 +
...ootstrapAutoInitialize_CPP_Default.vcxproj | 6 +
...AutoInitialize_CPP_Options_Default.vcxproj | 6 +
...AutoInitialize_CPP_Options_Defined.vcxproj | 6 +
...rapAutoInitialize_CPP_Options_None.vcxproj | 6 +
..._BootstrapAutoInitialize_CS_Default.csproj | 5 +
...apAutoInitialize_CS_Options_Default.csproj | 5 +
...apAutoInitialize_CS_Options_Defined.csproj | 5 +
...strapAutoInitialize_CS_Options_None.csproj | 5 +
.../appxmanifest.xml | 6 +
test/test.autoinitializer.CS.targets | 21 +++
test/test.autoinitializer.Native.targets | 25 +++
64 files changed, 1500 insertions(+), 28 deletions(-)
create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets
create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets
create mode 100644 build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets
create mode 100644 build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets
create mode 100644 build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets
create mode 100644 build/VersionInfo/AssemblyInfo.h
create mode 100644 dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h
create mode 100644 dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml
create mode 100644 dev/Common/WindowsAppRuntimeAutoInitializer.cpp
create mode 100644 dev/Common/WindowsAppRuntimeAutoInitializer.cs
create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.cpp
create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.h
create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.idl
create mode 100644 dev/CompatibilityOptions/CompatibilityOptions.vcxitems
create mode 100644 test/Compatibility/CompatibilityTests/CompatibilityTests.cpp
create mode 100644 test/Compatibility/CompatibilityTests/CompatibilityTests.testdef
create mode 100644 test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj
create mode 100644 test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters
create mode 100644 test/Compatibility/CompatibilityTests/packages.config
create mode 100644 test/Compatibility/CompatibilityTests/pch.cpp
create mode 100644 test/Compatibility/CompatibilityTests/pch.h
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CPP/pch.h
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CS/Program.cs
create mode 100644 test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj
create mode 100644 test/test.autoinitializer.CS.targets
create mode 100644 test/test.autoinitializer.Native.targets
diff --git a/BuildAll.ps1 b/BuildAll.ps1
index 2549f2467b..a883e697b5 100644
--- a/BuildAll.ps1
+++ b/BuildAll.ps1
@@ -277,14 +277,19 @@ Try {
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.props" -Destination "$BasePath\build\native\Microsoft.WindowsAppSDK.Foundation.props"
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.C.props" -Destination "$BasePath\build\native"
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.WinRt.props" -Destination "$BasePath\build\native"
+ Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.AutoInitializer.targets" -Destination "$BasePath\build\native"
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.Bootstrap.targets" -Destination "$BasePath\build\native"
+ Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets" -Destination "$BasePath\build\native"
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.DeploymentManager.targets" -Destination "$BasePath\build\native"
Copy-Item -Path "$nuSpecsPath\WindowsAppSDK-Nuget-Native.UndockedRegFreeWinRT.targets" -Destination "$BasePath\build\native"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Foundation.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Foundation.props" -Destination "$BasePath\build"
+ Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.AutoInitializer.CS.targets" -Destination "$BasePath\build"
+ Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.AutoInitializerCommon.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.Bootstrap.CS.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.BootstrapCommon.targets" -Destination "$BasePath\build"
+ Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManager.CS.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.DeploymentManagerCommon.targets" -Destination "$BasePath\build"
Copy-Item -Path "$nuSpecsPath\Microsoft.WindowsAppSDK.UndockedRegFreeWinRT.CS.targets" -Destination "$BasePath\build"
diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln
index d9c55d3f34..2d8f0e9b39 100644
--- a/WindowsAppRuntime.sln
+++ b/WindowsAppRuntime.sln
@@ -577,6 +577,20 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BaseNotifications", "dev\Notifications\BaseNotifications\BaseNotifications.vcxitems", "{2BD7A1BB-D3D8-484F-9180-409D781DCCF9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Windows.BadgeNotifications.Projection", "dev\Projections\CS\Microsoft.Windows.BadgeNotifications.Projection\Microsoft.Windows.BadgeNotifications.Projection.csproj", "{A243A58D-ABD7-4520-8C71-F492247B7B92}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityOptions", "dev\CompatibilityOptions\CompatibilityOptions.vcxitems", "{1F7B9E9F-9987-490B-9E6E-093C7F63FEC4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CompatibilityOptions", "CompatibilityOptions", "{35972D8A-F47E-4875-A341-E8C25DB7A098}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CompatibilityTests", "test\Compatibility\CompatibilityTests\CompatibilityTests.vcxproj", "{040BB64B-012E-4E4F-BB02-E85EF46D3475}"
+ ProjectSection(ProjectDependencies) = postProject
+ {F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746}
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compatibility", "Compatibility", "{423E7BAC-0125-46F4-944D-E8F138B3C654}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test_CompatibilitySetter_CPP", "test\Compatibility\Test_CompatibilitySetter_CPP\Test_CompatibilitySetter_CPP.vcxproj", "{7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_CompatibilitySetter_CS", "test\Compatibility\Test_CompatibilitySetter_CS\Test_CompatibilitySetter_CS.csproj", "{42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -2030,6 +2044,54 @@ Global
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x64.Build.0 = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x86.ActiveCfg = Release|Any CPU
{A243A58D-ABD7-4520-8C71-F492247B7B92}.Release|x86.Build.0 = Release|Any CPU
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|Any CPU.Build.0 = Debug|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|ARM64.Build.0 = Debug|ARM64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.ActiveCfg = Debug|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x64.Build.0 = Debug|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.ActiveCfg = Debug|Win32
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Debug|x86.Build.0 = Debug|Win32
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.ActiveCfg = Release|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|Any CPU.Build.0 = Release|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.ActiveCfg = Release|ARM64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|ARM64.Build.0 = Release|ARM64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.ActiveCfg = Release|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x64.Build.0 = Release|x64
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.ActiveCfg = Release|Win32
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475}.Release|x86.Build.0 = Release|Win32
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|Any CPU.Build.0 = Debug|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|ARM64.Build.0 = Debug|ARM64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.ActiveCfg = Debug|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x64.Build.0 = Debug|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.ActiveCfg = Debug|Win32
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Debug|x86.Build.0 = Debug|Win32
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.ActiveCfg = Release|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|Any CPU.Build.0 = Release|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.ActiveCfg = Release|ARM64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|ARM64.Build.0 = Release|ARM64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.ActiveCfg = Release|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x64.Build.0 = Release|x64
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.ActiveCfg = Release|Win32
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA}.Release|x86.Build.0 = Release|Win32
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|ARM64.Build.0 = Debug|ARM64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.ActiveCfg = Debug|x64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x64.Build.0 = Debug|x64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.ActiveCfg = Debug|x86
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Debug|x86.Build.0 = Debug|x86
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.ActiveCfg = Release|ARM64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|ARM64.Build.0 = Release|ARM64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.ActiveCfg = Release|x64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x64.Build.0 = Release|x64
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.ActiveCfg = Release|x86
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -2215,6 +2277,12 @@ Global
{85D111C7-B720-4E19-A56D-03C87B953983} = {50205ED9-0E08-4878-B124-9AC0EBA138D6}
{2BD7A1BB-D3D8-484F-9180-409D781DCCF9} = {586EA218-74C8-420B-B47E-0B307AA4B82D}
{A243A58D-ABD7-4520-8C71-F492247B7B92} = {716C26A0-E6B0-4981-8412-D14A4D410531}
+ {1F7B9E9F-9987-490B-9E6E-093C7F63FEC4} = {35972D8A-F47E-4875-A341-E8C25DB7A098}
+ {35972D8A-F47E-4875-A341-E8C25DB7A098} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
+ {040BB64B-012E-4E4F-BB02-E85EF46D3475} = {423E7BAC-0125-46F4-944D-E8F138B3C654}
+ {423E7BAC-0125-46F4-944D-E8F138B3C654} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
+ {7FAFCBD2-BDD5-433C-B3D4-700B5C5A67AA} = {423E7BAC-0125-46F4-944D-E8F138B3C654}
+ {42B6776C-2CCA-4C0B-8555-7121AA9AEDA9} = {423E7BAC-0125-46F4-944D-E8F138B3C654}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
@@ -2223,6 +2291,7 @@ Global
test\inc\inc.vcxitems*{08bc78e0-63c6-49a7-81b3-6afc3deac4de}*SharedItemsImports = 4
dev\PushNotifications\PushNotifications.vcxitems*{103c0c23-7ba8-4d44-a63c-83488e2e3a81}*SharedItemsImports = 9
dev\Notifications\BaseNotifications\BaseNotifications.vcxitems*{2bd7a1bb-d3d8-484f-9180-409d781dccf9}*SharedItemsImports = 9
+ dev\CompatibilityOptions\CompatibilityOptions.vcxitems*{1f7b9e9f-9987-490b-9e6e-093c7f63fec4}*SharedItemsImports = 9
dev\EnvironmentManager\API\Microsoft.Process.Environment.vcxitems*{2f3fad1b-d3df-4866-a3a3-c2c777d55638}*SharedItemsImports = 9
dev\OAuth\OAuth.vcxitems*{3e7fd510-8b66-40e7-a80b-780cb8972f83}*SharedItemsImports = 9
test\inc\inc.vcxitems*{412d023e-8635-4ad2-a0ea-e19e08d36915}*SharedItemsImports = 4
@@ -2244,6 +2313,7 @@ Global
dev\ApplicationData\ApplicationData.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\BackgroundTask\BackgroundTaskBuilder\BackgroundTaskBuilder.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\Common\Common.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
+ dev\CompatibilityOptions\CompatibilityOptions.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\DynamicDependency\API\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\Licensing\Licensing.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\PackageManager\API\PackageManager.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml
index 12f9ef0e1c..f085304fc5 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml
@@ -195,6 +195,14 @@ steps:
arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-OAuth.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Security.Authentication.OAuth -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-OAuth.h
workingDirectory: '$(Build.SourcesDirectory)'
+- task: powershell@2
+ displayName: 'Create CompatibilityOptions TerminalVelocity features'
+ inputs:
+ targetType: filePath
+ filePath: tools\TerminalVelocity\Generate-TerminalVelocityFeatures.ps1
+ arguments: -Path $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml -Channel $(channel) -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Output $(Build.SourcesDirectory)\dev\common\TerminalVelocityFeatures-CompatibilityOptions.h
+ workingDirectory: '$(Build.SourcesDirectory)'
+
- task: powershell@2
name: UpdateTraceloggingConfig
inputs:
diff --git a/build/CopyFilesToStagingDir.ps1 b/build/CopyFilesToStagingDir.ps1
index f73036ee7c..e3165ac28b 100644
--- a/build/CopyFilesToStagingDir.ps1
+++ b/build/CopyFilesToStagingDir.ps1
@@ -212,6 +212,10 @@ PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windo
PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\StrippedWinMD\Microsoft.Windows.System.winmd $NugetDir\lib\uap10.0
PublishFile $FullBuildOutput\WindowsAppRuntime_UniversalBGTaskDLL\Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.winmd $NugetDir\lib\uap10.0
#
+# Common Auto-Initializer Files
+PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\WindowsAppRuntimeAutoInitializer.cpp $NugetDir\include
+PublishFile $FullBuildOutput\WindowsAppRuntime_DLL\WindowsAppRuntimeAutoInitializer.cs $NugetDir\include
+#
# Bootstrap Auto-Initializer Files
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cpp $NugetDir\include
PublishFile $FullBuildOutput\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cs $NugetDir\include
diff --git a/build/NuSpecs/AppxManifest.xml b/build/NuSpecs/AppxManifest.xml
index 6dac600300..630f446630 100644
--- a/build/NuSpecs/AppxManifest.xml
+++ b/build/NuSpecs/AppxManifest.xml
@@ -114,6 +114,9 @@
+
+
+
diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets
new file mode 100644
index 0000000000..309ac6058e
--- /dev/null
+++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializer.CS.targets
@@ -0,0 +1,19 @@
+
+
+
+
+
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY
+
+
+
+
+
+
+
+
+
+
diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets
new file mode 100644
index 0000000000..287befbad2
--- /dev/null
+++ b/build/NuSpecs/Microsoft.WindowsAppSDK.AutoInitializerCommon.targets
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+ true
+
+
+
diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets
new file mode 100644
index 0000000000..6c2924fc3b
--- /dev/null
+++ b/build/NuSpecs/Microsoft.WindowsAppSDK.CompatibilitySetter.CS.targets
@@ -0,0 +1,64 @@
+
+
+
+
+
+ true
+
+
+
+
+ $(GeneratedFilesDir)\WindowsAppSDK\
+ $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', 'Generated Files', 'WindowsAppSDK'))
+
+ $(WindowsAppSDKGeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cs
+
+ compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode.Replace(".", ",")))%3B
+
+
+ compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion($(WindowsAppSDKRuntimePatchMode2.Replace(".", ",")))%3B
+
+
+ $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", ""))
+
+ var disabledChangesArray = new CompatibilityChange[] { CompatibilityChange.$([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange.$1")) }%3B
+ foreach (var changeId in disabledChangesArray)
+ {
+ compatibilityOptions.DisabledChanges.Add(changeId)%3B
+ }
+
+
+
+using Microsoft.Windows.ApplicationModel.WindowsAppRuntime%3B
+
+// This file is generated by the build based on project properties.
+namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility
+{
+ class AutoInitialize
+ {
+ // Called by WindowsAppRuntimeAutoInitializer.cs
+ internal static void ConfigureCompatibility()
+ {
+ var compatibilityOptions = new CompatibilityOptions()%3B
+$(WindowsAppSDKCompatibilityPatchMode1Lines)
+$(WindowsAppSDKCompatibilityPatchMode2Lines)
+$(WindowsAppSDKCompatibilityDisabledChangesLines)
+ compatibilityOptions.Apply()%3B
+ }
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets
index 73434d043d..3a98933c31 100644
--- a/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets
+++ b/build/NuSpecs/Microsoft.WindowsAppSDK.Foundation.targets
@@ -13,6 +13,11 @@
+
+
+
+
+
diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets
new file mode 100644
index 0000000000..ae3313a43a
--- /dev/null
+++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.AutoInitializer.targets
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ NotUsing
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ $(BeforeClCompileTargets); WindowsAppRuntimeAutoInitializer;
+
+
+
+
diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets
new file mode 100644
index 0000000000..845d3b2ff5
--- /dev/null
+++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.CompatibilitySetter.targets
@@ -0,0 +1,73 @@
+
+
+
+
+
+ true
+
+
+
+
+ $(GeneratedFilesDir)WindowsAppSDKCompatibilitySetter.cpp
+
+ compatibilityOptions.PatchMode1({$(WindowsAppSDKRuntimePatchMode.Replace(".", ","))})%3B
+
+
+ compatibilityOptions.PatchMode2({$(WindowsAppSDKRuntimePatchMode2.Replace(".", ","))})%3B
+
+ $([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKDisabledChanges), "\s+", ""))
+
+ CompatibilityChange disabledChangesArray[] = { CompatibilityChange::$([System.Text.RegularExpressions.Regex]::Replace($(WindowsAppSDKCompatibilityDisabledChangesNoSpaces), ",([A-Za-z])", ", CompatibilityChange::$1")) }%3B
+ for (auto changeId : disabledChangesArray)
+ {
+ compatibilityOptions.DisabledChanges().Append(changeId)%3B
+ }
+
+
+
+// This file is generated by the build based on project properties.
+#include <winrt/Windows.Foundation.h>
+#include <winrt/Windows.Foundation.Collections.h>
+
+#include <winrt/Microsoft.Windows.ApplicationModel.WindowsAppRuntime.h>
+
+using namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime%3B
+
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility
+{
+ namespace AutoInitialize
+ {
+ // Called by WindowsAppRuntimeAutoInitializer.cpp
+ void Initialize()
+ {
+ CompatibilityOptions compatibilityOptions%3B
+$(WindowsAppSDKCompatibilityPatchMode1Lines)
+$(WindowsAppSDKCompatibilityPatchMode2Lines)
+$(WindowsAppSDKCompatibilityDisabledChangesLines)
+ compatibilityOptions.Apply()%3B
+ }
+ }
+}
+
+
+
+
+
+
+
+ NotUsing
+
+
+
+
+
+
+ $(BeforeClCompileTargets); WindowsAppSDKCompatibilitySetterTarget;
+
+
+
+
diff --git a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
index 506c223359..a51d55d97c 100644
--- a/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
+++ b/build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
@@ -152,4 +152,9 @@
+
+
+
+
+
diff --git a/build/VersionInfo/AssemblyInfo.h b/build/VersionInfo/AssemblyInfo.h
new file mode 100644
index 0000000000..abc67be25e
--- /dev/null
+++ b/build/VersionInfo/AssemblyInfo.h
@@ -0,0 +1,14 @@
+// WARNING: the values in the AssemblyInfo file are defaults for use in dev-loop.
+// This file is meant to be overwritten by GenerateVersionInfo.ps1
+// Please modify the generation script in GenerateVersionInfo.ps1 to change any fields or values.
+
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#ifndef WINDOWSAPPSDK_RELEASE_MAJOR
+#define WINDOWSAPPSDK_RELEASE_MAJOR 1
+#endif
+
+#ifndef WINDOWSAPPSDK_RELEASE_MINOR
+#define WINDOWSAPPSDK_RELEASE_MINOR 7
+#endif
diff --git a/build/VersionInfo/GenerateVersionInfo.ps1 b/build/VersionInfo/GenerateVersionInfo.ps1
index 31bbadf45b..e2e8ec583f 100644
--- a/build/VersionInfo/GenerateVersionInfo.ps1
+++ b/build/VersionInfo/GenerateVersionInfo.ps1
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation and Contributors.
# Licensed under the MIT License.
-# This scripts overrides AssemblyInfo.cs and AssemblyInfo.ver in eng/common/VersionInfo.
+# This script overrides AssemblyInfo.cs, AssemblyInfo.ver, and AssemblyInfo.h in build/VersionInfo.
# The parameters ProductMajor and ProductMinor version will be used in the overwrite
# for the ProductVersion field
@@ -137,3 +137,23 @@ Write-Verbose $assemblyInfoVer
$assemblyInfoVerPath = "$scriptFullPath/AssemblyInfo.ver"
Write-Verbose "Writing $assemblyInfoVerPath..."
[System.IO.File]::WriteAllLines($assemblyInfoVerPath, $assemblyInfoVer, $utf8NoBomEncoding)
+
+# Generating AssemblyInfo.h override
+$assemblyInfoH = @"
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#ifndef WINDOWSAPPSDK_RELEASE_MAJOR
+#define WINDOWSAPPSDK_RELEASE_MAJOR $ProductMajor
+#endif
+
+#ifndef WINDOWSAPPSDK_RELEASE_MINOR
+#define WINDOWSAPPSDK_RELEASE_MINOR $ProductMinor
+#endif
+"@
+
+Write-Verbose $assemblyInfoH
+$assemblyInfoHPath = "$scriptFullPath/AssemblyInfo.h"
+Write-Verbose "Writing $assemblyInfoHPath..."
+[System.IO.File]::WriteAllLines($assemblyInfoHPath, $assemblyInfoH, $utf8NoBomEncoding)
+
diff --git a/dev/Common/Common.vcxitems b/dev/Common/Common.vcxitems
index 9fe4e51244..6b554ac6f2 100644
--- a/dev/Common/Common.vcxitems
+++ b/dev/Common/Common.vcxitems
@@ -32,4 +32,8 @@
-
\ No newline at end of file
+
+
+
+
+
diff --git a/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h
new file mode 100644
index 0000000000..a2c4f72cac
--- /dev/null
+++ b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.h
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT IT
+
+// INPUT FILE: .\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml
+// OPTIONS: -Channel Experimental -Language C++ -Namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime -Path .\dev\common\TerminalVelocityFeatures-CompatibilityOptions.xml -Output dev\common\TerminalVelocityFeatures-CompatibilityOptions.h
+
+#if defined(__midlrt)
+namespace features
+{
+ feature_name Feature_CompatibilityOptions = { DisabledByDefault, FALSE };
+}
+#endif // defined(__midlrt)
+
+// Feature constants
+#define WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED 1
+
+#if defined(__cplusplus)
+
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime
+{
+
+__pragma(detect_mismatch("ODR_violation_WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED_mismatch", "AlwaysEnabled"))
+struct Feature_CompatibilityOptions
+{
+ static constexpr bool IsEnabled() { return WINDOWSAPPRUNTIME_MICROSOFT_WINDOWS_APPLICATIONMODEL_WINDOWSAPPRUNTIME_FEATURE_COMPATIBILITYOPTIONS_ENABLED == 1; }
+};
+
+} // namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
+
+#endif // defined(__cplusplus)
diff --git a/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml
new file mode 100644
index 0000000000..7df32a6942
--- /dev/null
+++ b/dev/Common/TerminalVelocityFeatures-CompatibilityOptions.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+ Feature_CompatibilityOptions
+ CompatibilityOptions for the WindowsAppRuntime
+ AlwaysEnabled
+
+
diff --git a/dev/Common/WindowsAppRuntimeAutoInitializer.cpp b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp
new file mode 100644
index 0000000000..7596fb1e3b
--- /dev/null
+++ b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+// Forward-declare the various AutoInitialize functions
+namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap
+{
+ namespace AutoInitialize { void Initialize(); void Shutdown(); };
+}
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager
+{
+ namespace AutoInitialize { void Initialize(); };
+}
+namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT
+{
+ namespace AutoInitialize { void Initialize(); };
+}
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility
+{
+ namespace AutoInitialize { void Initialize(); };
+}
+
+// The common AutoInitialize struct that calls the various AutoInitialize functions
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Common
+{
+ struct AutoInitialize
+ {
+ AutoInitialize()
+ {
+ Initialize();
+ }
+
+ ~AutoInitialize()
+ {
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap::AutoInitialize::Shutdown();
+#endif
+ }
+
+ static void Initialize()
+ {
+ // Call the AutoInitialize functions, as needed, starting with those initializing the WindowsAppRuntime
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap::AutoInitialize::Initialize();
+#endif
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER
+ Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager::AutoInitialize::Initialize();
+#endif
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT
+ Microsoft::Windows::Foundation::UndockedRegFreeWinRT::AutoInitialize::Initialize();
+#endif
+
+ // Compatibility happens just after initializing WindowsAppRuntime
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY
+ Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility::AutoInitialize::Initialize();
+#endif
+ }
+ };
+ static AutoInitialize g_autoInitialize;
+}
diff --git a/dev/Common/WindowsAppRuntimeAutoInitializer.cs b/dev/Common/WindowsAppRuntimeAutoInitializer.cs
new file mode 100644
index 0000000000..e947953fc4
--- /dev/null
+++ b/dev/Common/WindowsAppRuntimeAutoInitializer.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//
+// Exclude this file from StyleCop analysis. This file isn't generated but is added to projects.
+// DO NOT MODIFY. Changes to this file may cause incorrect behavior and will be lost on updates.
+//
+
+
+namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Common
+{
+ class AutoInitialize
+ {
+ [global::System.Runtime.CompilerServices.ModuleInitializer]
+ internal static void InitializeWindowsAppSDK()
+ {
+ // Call the AutoInitialize functions, as needed, starting with those initializing the WindowsAppRuntime
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS.AutoInitialize.AccessWindowsAppSDK();
+#endif
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER
+ Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.AccessWindowsAppSDK();
+#endif
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT
+ Microsoft.Windows.Foundation.UndockedRegFreeWinRTCS.AutoInitialize.AccessWindowsAppSDK();
+#endif
+
+ // Compatibility happens just after initializing WindowsAppRuntime
+#if MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY
+ Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility();
+#endif
+ }
+ }
+}
+
diff --git a/dev/CompatibilityOptions/CompatibilityOptions.cpp b/dev/CompatibilityOptions/CompatibilityOptions.cpp
new file mode 100644
index 0000000000..8f41e0d586
--- /dev/null
+++ b/dev/CompatibilityOptions/CompatibilityOptions.cpp
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#include "pch.h"
+#include "CompatibilityOptions.h"
+#include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.cpp"
+#include "AssemblyInfo.h"
+#include
+
+namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
+{
+ winrt::Windows::Foundation::Collections::IVector CompatibilityOptions::DisabledChanges()
+ {
+ return m_disabledChanges;
+ }
+
+ void CompatibilityOptions::Apply()
+ {
+ WinAppSdk::Containment::WinAppSDKRuntimeConfiguration config;
+
+ // If both patch modes are set to the same major.minor version, error out if the patch versions are different.
+ if (m_patchMode1.Major == m_patchMode2.Major && m_patchMode1.Minor == m_patchMode2.Minor &&
+ m_patchMode1.Major != 0)
+ {
+ if (m_patchMode1.Patch != m_patchMode2.Patch)
+ {
+ throw hresult_invalid_argument(L"Patch modes should target different Major.Minor versions or match Patch version.");
+ }
+ }
+
+ // Apply the patch mode which applies to the major.minor version, if any.
+ if (m_patchMode1.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchMode1.Minor == WINDOWSAPPSDK_RELEASE_MINOR)
+ {
+ // Apply patch mode 1
+ config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchMode1.Major, m_patchMode1.Minor, m_patchMode1.Patch);
+ }
+ else if (m_patchMode2.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchMode2.Minor == WINDOWSAPPSDK_RELEASE_MINOR)
+ {
+ // Apply patch mode 2
+ config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchMode2.Major, m_patchMode2.Minor, m_patchMode2.Patch);
+ }
+
+ // Add the set of disabled changes
+ std::vector disabledChanges;
+ for (auto changeId : m_disabledChanges)
+ {
+ // TODO: Telemetry! Log the changeId that was disabled.
+ // UINT32 is used internally for the changeId, so cast from the enum's Int32 to that.
+ disabledChanges.push_back(static_cast(changeId));
+ }
+ config.disabledChanges = disabledChanges.data();
+ config.disabledChangesCount = static_cast(disabledChanges.size());
+
+ HRESULT hr = WinAppSdk::Containment::SetConfiguration(&config);
+ if (FAILED(hr))
+ {
+ if (hr == E_ILLEGAL_STATE_CHANGE)
+ {
+ throw winrt::hresult_illegal_state_change(L"Configuration already set or locked.");
+ }
+ winrt::throw_hresult(hr);
+ }
+ }
+}
diff --git a/dev/CompatibilityOptions/CompatibilityOptions.h b/dev/CompatibilityOptions/CompatibilityOptions.h
new file mode 100644
index 0000000000..5bfb25c69d
--- /dev/null
+++ b/dev/CompatibilityOptions/CompatibilityOptions.h
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#pragma once
+
+#include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.CompatibilityOptions.g.h"
+
+namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
+{
+ struct CompatibilityOptions : CompatibilityOptionsT
+ {
+ CompatibilityOptions() = default;
+
+ WindowsAppRuntimeVersion PatchMode1() { return m_patchMode1; }
+ void PatchMode1(WindowsAppRuntimeVersion const& value) { m_patchMode1 = value; }
+ WindowsAppRuntimeVersion PatchMode2() { return m_patchMode2; }
+ void PatchMode2(WindowsAppRuntimeVersion const& value) { m_patchMode2 = value; }
+ winrt::Windows::Foundation::Collections::IVector DisabledChanges();
+
+ void Apply();
+
+ private:
+ WindowsAppRuntimeVersion m_patchMode1{ 0, 0, 0 };
+ WindowsAppRuntimeVersion m_patchMode2{ 0, 0, 0 };
+ winrt::Windows::Foundation::Collections::IVector m_disabledChanges{ winrt::single_threaded_vector() };
+ };
+}
+
+namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::factory_implementation
+{
+ struct CompatibilityOptions : CompatibilityOptionsT
+ {
+ };
+}
diff --git a/dev/CompatibilityOptions/CompatibilityOptions.idl b/dev/CompatibilityOptions/CompatibilityOptions.idl
new file mode 100644
index 0000000000..42554cecf2
--- /dev/null
+++ b/dev/CompatibilityOptions/CompatibilityOptions.idl
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#include
+
+namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
+{
+ /// The set of servicing changes that can be disabled.
+ enum CompatibilityChange
+ {
+ None = 0, /// do not use this value
+
+ // Add real changes here:
+
+ // 1.7.1
+ // ...
+ };
+
+ [contractversion(1)]
+ apicontract CompatibilityContract {};
+
+ /// Represents a version of the Windows App Runtime.
+ [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)]
+ struct WindowsAppRuntimeVersion
+ {
+ UInt32 Major;
+ UInt32 Minor;
+ UInt32 Patch;
+ };
+
+ /// This object is used by the app to configure any desired compatibility options
+ /// for Windows App Runtime behavior of changes added in servicing updates. This
+ /// object is only used to set the runtime behavior and can't be used to query the
+ /// applied options.
+ // TODO: Get agreement and add a generic Feature_Experimental
+ [contract(CompatibilityContract, 1), feature(Feature_CompatibilityOptions)]
+ runtimeclass CompatibilityOptions
+ {
+ CompatibilityOptions();
+
+ /// An optional patch mode to use if the runtime version matches the major.minor version.
+ WindowsAppRuntimeVersion PatchMode1 { get; set; };
+
+ /// An optional patch mode to use if the runtime version matches the major.minor version.
+ WindowsAppRuntimeVersion PatchMode2 { get; set; };
+
+ /// An optional list of specific servicing changes to disable.
+ IVector DisabledChanges{ get; };
+
+ /// Apply the compatibility options to the runtime.
+ void Apply();
+ }
+}
diff --git a/dev/CompatibilityOptions/CompatibilityOptions.vcxitems b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems
new file mode 100644
index 0000000000..85891246c9
--- /dev/null
+++ b/dev/CompatibilityOptions/CompatibilityOptions.vcxitems
@@ -0,0 +1,32 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ {1f7b9e9f-9987-490b-9e6e-093c7f63fec4}
+
+
+
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)
+
+
+
+
+
+
+
+
+
+
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dev/Deployment/DeploymentManagerAutoInitializer.cpp b/dev/Deployment/DeploymentManagerAutoInitializer.cpp
index f48b7be070..07a3bcaf7e 100644
--- a/dev/Deployment/DeploymentManagerAutoInitializer.cpp
+++ b/dev/Deployment/DeploymentManagerAutoInitializer.cpp
@@ -24,15 +24,8 @@
namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager
{
- struct AutoInitialize
+ namespace AutoInitialize
{
- AutoInitialize()
- {
- Initialize();
- }
-
- ~AutoInitialize() = default;
-
static ::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentInitializeOptions Options()
{
::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentInitializeOptions options;
@@ -50,7 +43,8 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentMan
return options;
}
- static void Initialize()
+ // Called by WindowsAppRuntimeAutoInitializer.cpp
+ void Initialize()
{
auto options{ Options() };
auto deploymentResult{ ::winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentManager::Initialize(options) };
@@ -61,5 +55,4 @@ namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::DeploymentMan
}
}
};
- static AutoInitialize g_autoInitialize;
}
diff --git a/dev/Deployment/DeploymentManagerAutoInitializer.cs b/dev/Deployment/DeploymentManagerAutoInitializer.cs
index 3031f8012c..f31259f157 100644
--- a/dev/Deployment/DeploymentManagerAutoInitializer.cs
+++ b/dev/Deployment/DeploymentManagerAutoInitializer.cs
@@ -24,7 +24,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManager
{
class AutoInitialize
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
+ // Called by WindowsAppRuntimeAutoInitializer.cs
internal static void AccessWindowsAppSDK()
{
var options = Options;
diff --git a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp
index e22415b6c3..2ca590db64 100644
--- a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp
+++ b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp
@@ -12,9 +12,10 @@ STDAPI WindowsAppRuntime_EnsureIsLoaded();
namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT
{
- struct AutoInitialize
+ namespace AutoInitialize
{
- AutoInitialize()
+ // Called by WindowsAppRuntimeAutoInitializer.cpp
+ void Initialize()
{
// Load the Windows App SDK runtime DLL. The only reason this could fail
// is if the loading application using WinAppSDK/SelfContained has a
@@ -38,5 +39,4 @@ namespace Microsoft::Windows::Foundation::UndockedRegFreeWinRT
#endif
}
};
- static AutoInitialize g_autoInitialize;
}
diff --git a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs
index e9a29c56f1..2e07c542df 100644
--- a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs
+++ b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cs
@@ -20,7 +20,7 @@ internal static class NativeMethods
class AutoInitialize
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
+ // Called by WindowsAppRuntimeAutoInitializer.cs
internal static void AccessWindowsAppSDK()
{
// Set base directory env var for PublishSingleFile support (referenced by SxS redirection)
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp
index 777a696e84..f2aa32d42a 100644
--- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp
+++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp
@@ -24,14 +24,10 @@
namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap
{
- struct AutoInitialize
+ namespace AutoInitialize
{
- AutoInitialize()
- {
- Initialize();
- }
-
- ~AutoInitialize()
+ // Called by WindowsAppRuntimeAutoInitializer.cpp
+ void Shutdown()
{
::MddBootstrapShutdown();
}
@@ -66,7 +62,8 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap
#endif
}
- static void Initialize()
+ // Called by WindowsAppRuntimeAutoInitializer.cpp
+ void Initialize()
{
const UINT32 c_majorMinorVersion{ WINDOWSAPPSDK_RELEASE_MAJORMINOR };
PCWSTR c_versionTag{ WINDOWSAPPSDK_RELEASE_VERSION_TAG_W };
@@ -79,5 +76,4 @@ namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap
}
}
};
- static AutoInitialize g_autoInitialize;
}
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs
index bbd9503bdc..19b7ec350e 100644
--- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs
+++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cs
@@ -28,7 +28,7 @@ namespace Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS
{
class AutoInitialize
{
- [global::System.Runtime.CompilerServices.ModuleInitializer]
+ // Called by WindowsAppRuntimeAutoInitializer.cs
internal static void AccessWindowsAppSDK()
{
uint majorMinorVersion = global::Microsoft.WindowsAppSDK.Release.MajorMinor;
diff --git a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
index 4ffc28bcad..569ff9bd0a 100644
--- a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
+++ b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
@@ -104,6 +104,7 @@
+
diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md
index b5b5aa15cf..e66de020fe 100644
--- a/docs/Coding-Guidelines/GettingStarted.md
+++ b/docs/Coding-Guidelines/GettingStarted.md
@@ -83,10 +83,12 @@ harmless if your configuration is current with no changes needed.
# Tada!
-Now you're ready to load `WindowsAppSDK.sln` and start development!
+Now you're ready to load `WindowsAppRuntime.sln` and start development!
Some tips:
+* If VS starts in a configuration of `Any CPU`, switch to a specific architecture like `x64`
+ to successfully build.
* Build everything in VS via the Build menu's `Build Solution` or `Rebuild Solution`
* Right-click on individual projects in Solution Explorer to only build select projects.
Dependencies and Build Order should be defined to build prerequisites (if necessary) for the
diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp
new file mode 100644
index 0000000000..8bbe369856
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#include "pch.h"
+#include "AssemblyInfo.h"
+
+#include
+#include
+
+namespace TB = ::Test::Bootstrap;
+namespace TP = ::Test::Packages;
+
+namespace WAR = winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime;
+
+namespace Test::CompatibilityTests
+{
+ class CompatibilityTests
+ {
+ public:
+ BEGIN_TEST_CLASS(CompatibilityTests)
+ TEST_CLASS_PROPERTY(L"ThreadingModel", L"MTA") // MTA is required for ::Test::Bootstrap::SetupPackages()
+ TEST_CLASS_PROPERTY(L"RunFixtureAs:Class", L"RestrictedUser")
+ TEST_CLASS_PROPERTY(L"IsolationLevel", L"Method") // each test sets its own CompatibilityOptions
+ END_TEST_CLASS()
+
+ TEST_CLASS_SETUP(ClassSetup)
+ {
+ ::Test::Bootstrap::SetupPackages();
+ return true;
+ }
+
+ TEST_CLASS_CLEANUP(ClassCleanup)
+ {
+ ::Test::Bootstrap::CleanupPackages();
+ return true;
+ }
+
+ TEST_METHOD_SETUP(MethodInit)
+ {
+ VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework());
+
+ // The test method setup and execution is on a different thread than the class setup.
+ // Initialize the framework for the test thread.
+ ::Test::Bootstrap::SetupBootstrap();
+ return true;
+ }
+
+ TEST_METHOD_CLEANUP(MethodUninit)
+ {
+ VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework());
+ ::Test::Bootstrap::CleanupBootstrap();
+ return true;
+ }
+
+ TEST_METHOD(CanSetCompatibilityOptions)
+ {
+ WEX::Logging::Log::Comment(WEX::Common::String(L"Starting CanSetCompatibilityOptions..."));
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options;
+ WEX::Logging::Log::Comment(WEX::Common::String(L" Created CompatibilityOptions..."));
+ options.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 3 });
+ options.Apply();
+ WEX::Logging::Log::Comment(WEX::Common::String(L" Applied CompatibilityOptions..."));
+
+ try
+ {
+ WEX::Logging::Log::Comment(WEX::Common::String(L" Applying CompatibilityOptions with different patch mode..."));
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options2;
+ options2.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 6 });
+ options2.Apply();
+ VERIFY_FAIL(L"Success is not expected when setting a different configuration");
+ }
+ catch (winrt::hresult_error& e)
+ {
+ VERIFY_ARE_EQUAL(E_ILLEGAL_STATE_CHANGE, e.code());
+ }
+
+ try
+ {
+ WEX::Logging::Log::Comment(WEX::Common::String(L" Applying CompatibilityOptions with no patch mode..."));
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options3;
+ options3.Apply();
+ VERIFY_FAIL(L"Success is not expected when setting a different configuration");
+ }
+ catch (winrt::hresult_error& e)
+ {
+ VERIFY_ARE_EQUAL(E_ILLEGAL_STATE_CHANGE, e.code());
+ }
+ }
+
+ TEST_METHOD(VerifyNoMatchingPatchModeBehavior)
+ {
+ WEX::Logging::Log::Comment(WEX::Common::String(L"Setting CompatibilityOptions with no matching patch mode"));
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options;
+ options.PatchMode1({ 0, 8, 3 });
+ options.PatchMode2({ 1, 1, 4 });
+ options.Apply();
+
+ // Set a CompatibilityOptions with no patch mode, which should be allowed since neither
+ // set a patch mode matching the runtime version.
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options2;
+ options2.Apply();
+ }
+
+ TEST_METHOD(VerifyConflictingPatchModeBehavior)
+ {
+ WEX::Logging::Log::Comment(WEX::Common::String(L"Setting CompatibilityOptions with conflicting patch modes"));
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options;
+ options.PatchMode1({ 1, 7, 3 });
+ options.PatchMode2({ 1, 7, 6 }); // Conflicting patch mode for 1.7.x! Apply should fail.
+ try
+ {
+ options.Apply();
+ VERIFY_FAIL(L"Success is not expected when setting a conflicting configuration");
+ }
+ catch (winrt::hresult_error& e)
+ {
+ VERIFY_ARE_EQUAL(E_INVALIDARG, e.code());
+ }
+ }
+
+ TEST_METHOD(VerifyDisabledChanges)
+ {
+ winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::CompatibilityOptions options;
+ options.PatchMode1({ WINDOWSAPPSDK_RELEASE_MAJOR, WINDOWSAPPSDK_RELEASE_MINOR, 3 });
+ options.DisabledChanges().Append((WAR::CompatibilityChange)12345);
+ options.DisabledChanges().Append((WAR::CompatibilityChange)23456);
+ options.DisabledChanges().Append((WAR::CompatibilityChange)34567);
+ options.DisabledChanges().Append(WAR::CompatibilityChange::None); // just to confirm compilation using a real enum value
+ options.Apply();
+
+ WEX::Logging::Log::Comment(WEX::Common::String(L"CompatibilityOptions with DisabledChanges applied."));
+
+ // Verify that the specified DisabledChanges are disabled.
+ VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<12345, WinAppSDK_Security>()));
+ VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<23456, WinAppSDK_Security>()));
+ VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<34567, WinAppSDK_Security>()));
+
+ // A different value not in DisabledChanges should remain enabled.
+ VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<99999, WinAppSDK_Security>()));
+ }
+ };
+}
diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef b/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef
new file mode 100644
index 0000000000..74ab26c2d6
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.testdef
@@ -0,0 +1,11 @@
+{
+ "Tests": [
+ {
+ "Description": "CompatibilityOptions tests (x86 not currently enabled)",
+ "Filename": "CompatibilityTests.dll",
+ "Parameters": "",
+ "Architectures": ["x64", "arm64"],
+ "Status": "Enabled"
+ }
+ ]
+}
diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj
new file mode 100644
index 0000000000..ee37756ff4
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+ Debug
+ ARM64
+
+
+ Release
+ ARM64
+
+
+
+ 17.0
+ Win32Proj
+ {040bb64b-012e-4e4f-bb02-e85ef46d3475}
+ CompatibilityTests
+ 10.0
+
+
+ DynamicLibrary
+ v143
+ Unicode
+
+
+ false
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Use
+ true
+ pch.h
+ $(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(RepoRoot)\dev\common
+ $(RepoRoot);%(AdditionalIncludeDirectories)
+
+
+ Windows
+ onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;wex.common.lib;wex.logger.lib;te.common.lib;%(AdditionalDependencies)
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ WIN32;%(PreprocessorDefinitions)
+
+
+
+
+ Create
+
+
+ $(RepoRoot)\build\VersionInfo;%(AdditionalIncludeDirectories)
+
+
+
+
+
+
+
+
+
+
+ $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
+ true
+
+
+
+
+ {f76b776e-86f5-48c5-8fc7-d2795ecc9746}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
+
diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters
new file mode 100644
index 0000000000..dc1c446641
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj.filters
@@ -0,0 +1,36 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+
+
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/test/Compatibility/CompatibilityTests/packages.config b/test/Compatibility/CompatibilityTests/packages.config
new file mode 100644
index 0000000000..63e5716140
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/packages.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/test/Compatibility/CompatibilityTests/pch.cpp b/test/Compatibility/CompatibilityTests/pch.cpp
new file mode 100644
index 0000000000..a77728ba07
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/pch.cpp
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+// pch.cpp: source file corresponding to the pre-compiled header
+
+#include "pch.h"
+
+// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
diff --git a/test/Compatibility/CompatibilityTests/pch.h b/test/Compatibility/CompatibilityTests/pch.h
new file mode 100644
index 0000000000..d9ababf69f
--- /dev/null
+++ b/test/Compatibility/CompatibilityTests/pch.h
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#ifndef PCH_H
+#define PCH_H
+
+#include
+
+#include
+
+#include
+#include
+
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+#endif //PCH_H
diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj
new file mode 100644
index 0000000000..827c45f4b5
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj
@@ -0,0 +1,169 @@
+
+
+
+
+ 1.7.3
+ 1.8.2
+
+ None, None, (CompatibilityChange)23456, None
+
+
+
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+ Debug
+ ARM64
+
+
+ Release
+ ARM64
+
+
+
+ 17.0
+ Win32Proj
+ {7fafcbd2-bdd5-433c-b3d4-700b5c5a67aa}
+ TestCompatibilitySetterCPP
+ 10.0
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Use
+ true
+ pch.h
+ $(RepoRoot)\test\inc;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories);$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)\..\WindowsAppRuntime_BootstrapDLL;$(RepoRoot)\dev\common
+ $(RepoRoot);%(AdditionalIncludeDirectories)
+
+
+ Windows
+ onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;%(AdditionalDependencies)
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ WIN32;%(PreprocessorDefinitions)
+
+
+
+
+ Create
+
+
+
+
+
+ $(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
+ true
+
+
+
+
+ {f76b776e-86f5-48c5-8fc7-d2795ecc9746}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters
new file mode 100644
index 0000000000..a8a65633bf
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CPP/Test_CompatibilitySetter_CPP.vcxproj.filters
@@ -0,0 +1,17 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
\ No newline at end of file
diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp
new file mode 100644
index 0000000000..9c977dbf3e
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CPP/main.cpp
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#include "pch.h"
+#include
+
+namespace Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility
+{
+ namespace AutoInitialize { void Initialize(); };
+}
+
+int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, PSTR /*lpCmdLine*/, int /*nCmdShow*/)
+{
+ // Note: This test app currently only tests that the compatibility properties specified in
+ // the project file generates the Initialize() function and compiles successfully.
+ Microsoft::Windows::ApplicationModel::WindowsAppRuntime::Compatibility::AutoInitialize::Initialize();
+ // Apps using the or project properties should
+ // NOT directly call the above function. This test calls it just to verify that the function is generated.
+
+ return 0;
+}
diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp
new file mode 100644
index 0000000000..a77728ba07
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.cpp
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+// pch.cpp: source file corresponding to the pre-compiled header
+
+#include "pch.h"
+
+// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
diff --git a/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h
new file mode 100644
index 0000000000..7efade56bc
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CPP/pch.h
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License.
+
+#ifndef PCH_H
+#define PCH_H
+
+#include
+
+#include
+
+#include
+#include
+
+#include
+
+//#include
+
+//#include
+//#include
+//#include
+
+#include
+
+#endif //PCH_H
diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs
new file mode 100644
index 0000000000..a66d210f15
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CS/Program.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation and Contributors.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+using System;
+
+class Program
+{
+ static void Main(string[] args)
+ {
+ // Note: This test app currently only tests that the compatibility properties specified in
+ // the project file generates the ConfigureCompatibility() function and compiles successfully.
+ Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Compatibility.AutoInitialize.ConfigureCompatibility();
+ // Apps using the or project properties should
+ // NOT directly call the above function. This test calls it just to verify that the function is generated.
+
+ Console.WriteLine("hello world");
+ Environment.Exit(0);
+ }
+}
diff --git a/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj
new file mode 100644
index 0000000000..603519686e
--- /dev/null
+++ b/test/Compatibility/Test_CompatibilitySetter_CS/Test_CompatibilitySetter_CS.csproj
@@ -0,0 +1,33 @@
+
+
+
+ Exe
+ net6.0
+ net6.0-windows10.0.19041.0
+ 10.0.17763.0
+ x86;x64;arm64;AnyCPU
+
+
+
+
+
+
+
+
+ 1.7.3
+ 1.8.2
+
+ None, None, (CompatibilityChange)23456, None
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj
index d45927dca1..4b42c2047d 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Default/Test_DeploymentManagerAutoInitialize_CPP_Default.vcxproj
@@ -104,6 +104,12 @@
+
+
+ true
+
+
+
$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj
index c12c69907e..e3d453339b 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Default/Test_DeploymentManagerAutoInitialize_CPP_Options_Default.vcxproj
@@ -105,6 +105,12 @@
+
+
+ true
+
+
+
$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj
index 7f5cd6010a..bd4cd76a70 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined/Test_DeploymentManagerAutoInitialize_CPP_Options_Defined.vcxproj
@@ -105,6 +105,12 @@
+
+
+ true
+
+
+
$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj
index 2fea49a7fe..4ead437416 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CPP/Test_DeploymentManagerAutoInitialize_CPP_Options_None/Test_DeploymentManagerAutoInitialize_CPP_Options_None.vcxproj
@@ -105,6 +105,12 @@
+
+
+ true
+
+
+
$(OutDir)\..\WindowsAppRuntime_DLL\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj
index cdd19c17fb..f50fac0f73 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Default/Test_DeploymentManagerAutoInitialize_CS_Default.csproj
@@ -28,4 +28,9 @@
+
+ true
+
+
+
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj
index 667c0a8d09..22d03b0f0d 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Default/Test_DeploymentManagerAutoInitialize_CS_Options_Default.csproj
@@ -32,4 +32,9 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_DEFAULT
+
+ true
+
+
+
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj
index 9c2e6cd230..7cd30f6bbd 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_Defined/Test_DeploymentManagerAutoInitialize_CS_Options_Defined.csproj
@@ -32,4 +32,21 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_ONERROR_SHOWUI
+
+ true
+
+
+
+
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY
+
+
+
+
+
+
+
diff --git a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj
index dd7cb976ff..621efc53c0 100644
--- a/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj
+++ b/test/Deployment/Test_DeploymentManagerAutoInitialize/CS/Test_DeploymentManagerAutoInitialize_CS_Options_None/Test_DeploymentManagerAutoInitialize_CS_Options_None.csproj
@@ -32,4 +32,9 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_DEPLOYMENTMANAGER_AUTO_INITIALIZE_OPTIONS_NONE
+
+ true
+
+
+
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj
index 6ae0e95ea3..d6e38a1fc7 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Default/Test_BootstrapAutoInitialize_CPP_Default.vcxproj
@@ -104,6 +104,12 @@
+
+
+ true
+
+
+
{f76b776e-86f5-48c5-8fc7-d2795ecc9746}
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj
index 06b51e1b63..00fff1528a 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Default/Test_BootstrapAutoInitialize_CPP_Options_Default.vcxproj
@@ -105,6 +105,12 @@
+
+
+ true
+
+
+
{f76b776e-86f5-48c5-8fc7-d2795ecc9746}
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj
index c56712e266..5a34d17988 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_Defined/Test_BootstrapAutoInitialize_CPP_Options_Defined.vcxproj
@@ -109,6 +109,12 @@
+
+
+ true
+
+
+
{f76b776e-86f5-48c5-8fc7-d2795ecc9746}
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj
index 2fe73168e1..cef7c4d1b9 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CPP/Test_BootstrapAutoInitialize_CPP_Options_None/Test_BootstrapAutoInitialize_CPP_Options_None.vcxproj
@@ -105,6 +105,12 @@
+
+
+ true
+
+
+
{f76b776e-86f5-48c5-8fc7-d2795ecc9746}
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj
index 7b04aad9e2..b047757058 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Default/Test_BootstrapAutoInitialize_CS_Default.csproj
@@ -44,4 +44,9 @@
+
+ true
+
+
+
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj
index 698b55808d..13e52bf6e9 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Default/Test_BootstrapAutoInitialize_CS_Options_Default.csproj
@@ -48,4 +48,9 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_DEFAULT
+
+ true
+
+
+
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj
index decac1ca42..0e4a8f04b5 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_Defined/Test_BootstrapAutoInitialize_CS_Options_Defined.csproj
@@ -52,4 +52,9 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_ONPACKAGEIDENTITY_NOOP
+
+ true
+
+
+
diff --git a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj
index 76cd979f05..d115efc614 100644
--- a/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj
+++ b/test/DynamicDependency/Test_BootstrapAutoInitialize/CS/Test_BootstrapAutoInitialize_CS_Options_None/Test_BootstrapAutoInitialize_CS_Options_None.csproj
@@ -48,4 +48,9 @@
$(DefineConstants);MICROSOFT_WINDOWSAPPSDK_BOOTSTRAP_AUTO_INITIALIZE_OPTIONS_NONE
+
+ true
+
+
+
diff --git a/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml b/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml
index a4f395306f..c4c6300513 100644
--- a/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml
+++ b/test/DynamicDependency/data/Microsoft.WindowsAppRuntime.Framework/appxmanifest.xml
@@ -149,6 +149,12 @@
+
+
+ Microsoft.WindowsAppRuntime.dll
+
+
+
PushNotificationsLongRunningTask.ProxyStub.dll
diff --git a/test/test.autoinitializer.CS.targets b/test/test.autoinitializer.CS.targets
new file mode 100644
index 0000000000..017fada5ee
--- /dev/null
+++ b/test/test.autoinitializer.CS.targets
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT
+ $(DefineConstants);MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY
+
+
+
+
+
+
+
+
+
+
diff --git a/test/test.autoinitializer.Native.targets b/test/test.autoinitializer.Native.targets
new file mode 100644
index 0000000000..fd0b286896
--- /dev/null
+++ b/test/test.autoinitializer.Native.targets
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+ NotUsing
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_BOOTSTRAP;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_DEPLOYMENTMANAGER;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_UNDOCKEDREGFREEWINRT;%(PreprocessorDefinitions)
+ MICROSOFT_WINDOWSAPPSDK_AUTOINITIALIZE_COMPATIBILITY;%(PreprocessorDefinitions)
+
+
+
+
+
+
+ $(BeforeClCompileTargets); WindowsAppRuntimeAutoInitializer;
+
+
+
+