-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WACK certification error for transitive WinUI references (#4218)
WACK expects to be able to find WinMDs for type resolution purposes in the root of the AppX, but when WinUI 2 is referenced via framework package, the WinMD is instead placed in a WinMetadata subdirectory. As a result, applications that reference nuget packages with references to WinUI 2, WACK certification fails. I'm not sure whether placing the WinMD file in that directory is still needed, so to work around this issue in the safest manner, this adds an additional build target that places the WinMD where WACK certification needs it to be. An example of an issue that will be resolved by this fix: CommunityToolkit/Lottie-Windows#214
- Loading branch information
Showing
23 changed files
with
483 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/MUXCInterfaceImplementation.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "pch.h" | ||
#include "MUXCInterfaceImplementation.h" | ||
#if __has_include("MUXCInterfaceImplementation.g.cpp") | ||
#include "MUXCInterfaceImplementation.g.cpp" | ||
#endif | ||
|
||
using namespace winrt; | ||
using namespace Windows::UI::Xaml; | ||
|
||
namespace winrt::RuntimeComponentThatUsesMUX::implementation | ||
{ | ||
MUXCInterfaceImplementation::MUXCInterfaceImplementation() | ||
{ | ||
} | ||
|
||
winrt::Microsoft::UI::Xaml::Controls::IAnimatedVisual MUXCInterfaceImplementation::TryCreateAnimatedVisual( | ||
winrt::Windows::UI::Composition::Compositor const&, | ||
winrt::Windows::Foundation::IInspectable&) | ||
{ | ||
return nullptr; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/MUXCInterfaceImplementation.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "winrt/Windows.UI.Xaml.h" | ||
#include "winrt/Windows.UI.Xaml.Markup.h" | ||
#include "winrt/Windows.UI.Xaml.Controls.Primitives.h" | ||
#include "winrt/Microsoft.UI.Xaml.Controls.h" | ||
#include "MUXCInterfaceImplementation.g.h" | ||
|
||
namespace winrt::RuntimeComponentThatUsesMUX::implementation | ||
{ | ||
struct MUXCInterfaceImplementation : MUXCInterfaceImplementationT<MUXCInterfaceImplementation> | ||
{ | ||
MUXCInterfaceImplementation(); | ||
|
||
winrt::Microsoft::UI::Xaml::Controls::IAnimatedVisual TryCreateAnimatedVisual( | ||
winrt::Windows::UI::Composition::Compositor const& compositor, | ||
winrt::Windows::Foundation::IInspectable& diagnostics); | ||
}; | ||
} | ||
|
||
namespace winrt::RuntimeComponentThatUsesMUX::factory_implementation | ||
{ | ||
struct MUXCInterfaceImplementation : MUXCInterfaceImplementationT<MUXCInterfaceImplementation, implementation::MUXCInterfaceImplementation> | ||
{ | ||
}; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/MUXCInterfaceImplementation.idl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace RuntimeComponentThatUsesMUX | ||
{ | ||
[default_interface] | ||
runtimeclass MUXCInterfaceImplementation : Microsoft.UI.Xaml.Controls.IAnimatedVisualSource | ||
{ | ||
MUXCInterfaceImplementation(); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/PropertySheet.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ImportGroup Label="PropertySheets" /> | ||
<PropertyGroup Label="UserMacros" /> | ||
<!-- | ||
To customize common C++/WinRT project properties: | ||
* right-click the project node | ||
* expand the Common Properties item | ||
* select the C++/WinRT property page | ||
For more advanced scenarios, and complete documentation, please see: | ||
https://github.com/Microsoft/xlang/tree/master/src/package/cppwinrt/nuget | ||
--> | ||
<PropertyGroup /> | ||
<ItemDefinitionGroup /> | ||
</Project> |
3 changes: 3 additions & 0 deletions
3
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/RuntimeComponentThatUsesMUX.def
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
EXPORTS | ||
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE | ||
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE |
14 changes: 14 additions & 0 deletions
14
...ontrolsReleaseTest/RuntimeComponentThatUsesMUX/RuntimeComponentThatUsesMUX.native.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- | ||
Copyright (c) Microsoft Corporation. Licensed under the MIT License | ||
--> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<_WinmdDir>$(MSBuildThisFileDirectory)..\..\lib\uap10.0\</_WinmdDir> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="$(_WinmdDir)*.winmd"> | ||
<Private>false</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildThisFileDirectory)../RuntimeComponentThatUsesMUX.targets"/> | ||
</Project> |
28 changes: 28 additions & 0 deletions
28
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/RuntimeComponentThatUsesMUX.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> | ||
<metadata> | ||
<id>RuntimeComponentThatUsesMUX</id> | ||
<version>1.0.0</version> | ||
<title>RuntimeComponentThatUsesMUX</title> | ||
<authors>Microsoft</authors> | ||
<owners>Microsoft</owners> | ||
<description>This package tests the functionality of having a NuGet package reference Microsoft.UI.Xaml.</description> | ||
<copyright>© Microsoft Corporation. All rights reserved.</copyright> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<dependencies> | ||
<group targetFramework="UAP10.0.15063"> | ||
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.2.8" exclude="Build,Analyzers" /> | ||
<dependency id="Microsoft.UI.Xaml" version="2.5.0" exclude="Build,Analyzers" /> | ||
</group> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file target="build" src="RuntimeComponentThatUsesMUX.targets"/> | ||
<file target="build\native\RuntimeComponentThatUsesMUX.targets" src="RuntimeComponentThatUsesMUX.native.targets"/> | ||
|
||
<file target="lib\uap10.0" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\RuntimeComponentThatUsesMUX\RuntimeComponentThatUsesMUX.winmd"/> | ||
|
||
<file target="runtimes\win10-$BUILDARCH$\native" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\RuntimeComponentThatUsesMUX\RuntimeComponentThatUsesMUX.dll"/> | ||
<file target="runtimes\win10-$BUILDARCH$\native" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\RuntimeComponentThatUsesMUX\RuntimeComponentThatUsesMUX.pri"/> | ||
</files> | ||
</package> |
43 changes: 43 additions & 0 deletions
43
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/RuntimeComponentThatUsesMUX.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30803.129 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RuntimeComponentThatUsesMUX", "RuntimeComponentThatUsesMUX.vcxproj", "{267D7B40-556E-447B-A262-B59B300CC8F6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|arm = Debug|arm | ||
Debug|arm64 = Debug|arm64 | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|arm = Release|arm | ||
Release|arm64 = Release|arm64 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|arm.ActiveCfg = Debug|arm | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|arm.Build.0 = Debug|arm | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|arm64.ActiveCfg = Debug|arm64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|arm64.Build.0 = Debug|arm64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|x64.ActiveCfg = Debug|x64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|x64.Build.0 = Debug|x64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Debug|x86.Build.0 = Debug|Win32 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|arm.ActiveCfg = Release|arm | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|arm.Build.0 = Release|arm | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|arm64.ActiveCfg = Release|arm64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|arm64.Build.0 = Release|arm64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|x64.ActiveCfg = Release|x64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|x64.Build.0 = Release|x64 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|x86.ActiveCfg = Release|Win32 | ||
{267D7B40-556E-447B-A262-B59B300CC8F6}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {E4731583-0CEA-4289-A2E3-75D1563D9671} | ||
EndGlobalSection | ||
EndGlobal |
16 changes: 16 additions & 0 deletions
16
test/MUXControlsReleaseTest/RuntimeComponentThatUsesMUX/RuntimeComponentThatUsesMUX.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!-- | ||
Copyright (c) Microsoft Corporation. Licensed under the MIT License | ||
--> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<_RuntimeIdentifier Condition="'$(Platform)' == 'Win32'">win10-x86</_RuntimeIdentifier> | ||
<_RuntimeIdentifier Condition="'$(Platform)' != 'Win32'">win10-$(Platform)</_RuntimeIdentifier> | ||
<_DllDir>$(MSBuildThisFileDirectory)..\runtimes\$(_WinUIRuntimeIdentifier)\native\</_DllDir> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ReferenceCopyLocalPaths Include="$(_DllDir)*.dll" /> | ||
<ReferenceCopyLocalPaths Include="$(_DllDir)*.pri" /> | ||
</ItemGroup> | ||
</Project> | ||
|
Oops, something went wrong.
@llongley We have WACK validation errors for only ARM64 arch of the C++/CX app using WinUI 2.7, that does not use .Net framework at all.
The reason is due _AddXamlWinmdToPackageLayoutRoot task being skipped for ARM64 as default .NET native toolchain from C:\Program Files (x86)\MSBuild\15.0.Net.NetNative\15.0.24211\ does not support ARM64 and BuildNativePackage task is not found for ARM64.