Skip to content

Commit d53f02c

Browse files
committed
Fix build issues in UWP projects
Use "MSBuild.NET.Extras.Sdk" instead of "MSBuild.Sdk.Extras" for projects. This replacement package contains fixes around UWP project setup and build!
1 parent b11a664 commit d53f02c

File tree

54 files changed

+143
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+143
-148
lines changed

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<PropertyGroup>
3232
<!-- Code CS8002 is a warning for strong named -> non-strong-named reference. This is valid for platforms other than .NET Framework (and is needed for the UWP targets. -->
3333
<NoWarn>$(NoWarn);CS8002</NoWarn>
34-
<!-- For including default @(Page) and @(Resource) items via 'MSBuild.Sdk.Extras' Sdk package. Also provides up to date check and file nesting -->
35-
<ExtrasEnableDefaultXamlItems>true</ExtrasEnableDefaultXamlItems>
34+
<!-- For including default @(Page) and @(Resource) items via 'MSBuild.NET.Extras.Sdk' Sdk package. Also provides up to date check and file nesting -->
35+
<EnableDefaultXamlItems>true</EnableDefaultXamlItems>
3636
</PropertyGroup>
3737
</When>
3838
</Choose>

Directory.Packages.props

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup Label="Core">
44
<NETStandardImplicitPackageVersion>2.0.3</NETStandardImplicitPackageVersion>
5-
<ExtrasUwpMetaPackageVersion>6.2.13</ExtrasUwpMetaPackageVersion>
65
</PropertyGroup>
76

87
<ItemGroup Label="Core">
@@ -12,8 +11,8 @@
1211
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.7.1" />
1312
<PackageVersion Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
1413
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
15-
<!-- MSBuild SDK Extras refernces the following package implicitly -->
16-
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" Condition="'$(_SdkShortFrameworkIdentifier)' != 'uap'" />
14+
<!-- MSBuild .NET Extras SDK refernces the following package implicitly -->
15+
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.13" Condition="'$(UsingMSBuildNETExtrasSdk)' != 'true'" />
1716
<!-- C# Compiler SDK -->
1817
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
1918
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />

GazeInputTest/GazeInputTest.csproj

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
</PropertyGroup>
2222
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2323
<DebugSymbols>true</DebugSymbols>
24-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
24+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
2525
<DebugType>full</DebugType>
2626
<PlatformTarget>x86</PlatformTarget>
2727
<UseVSHostingProcess>false</UseVSHostingProcess>
2828
<ErrorReport>prompt</ErrorReport>
2929
<Prefer32Bit>true</Prefer32Bit>
3030
</PropertyGroup>
3131
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
32-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
32+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
3333
<Optimize>true</Optimize>
3434
<DebugType>pdbonly</DebugType>
3535
<PlatformTarget>x86</PlatformTarget>
@@ -40,15 +40,15 @@
4040
</PropertyGroup>
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
4242
<DebugSymbols>true</DebugSymbols>
43-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
43+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
4444
<DebugType>full</DebugType>
4545
<PlatformTarget>ARM</PlatformTarget>
4646
<UseVSHostingProcess>false</UseVSHostingProcess>
4747
<ErrorReport>prompt</ErrorReport>
4848
<Prefer32Bit>true</Prefer32Bit>
4949
</PropertyGroup>
5050
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
51-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
51+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
5252
<Optimize>true</Optimize>
5353
<DebugType>pdbonly</DebugType>
5454
<PlatformTarget>ARM</PlatformTarget>
@@ -59,15 +59,15 @@
5959
</PropertyGroup>
6060
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
6161
<DebugSymbols>true</DebugSymbols>
62-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
62+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
6363
<DebugType>full</DebugType>
6464
<PlatformTarget>ARM64</PlatformTarget>
6565
<UseVSHostingProcess>false</UseVSHostingProcess>
6666
<ErrorReport>prompt</ErrorReport>
6767
<Prefer32Bit>true</Prefer32Bit>
6868
</PropertyGroup>
6969
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
70-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
70+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
7171
<Optimize>true</Optimize>
7272
<DebugType>pdbonly</DebugType>
7373
<PlatformTarget>ARM64</PlatformTarget>
@@ -78,15 +78,15 @@
7878
</PropertyGroup>
7979
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
8080
<DebugSymbols>true</DebugSymbols>
81-
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
81+
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
8282
<DebugType>full</DebugType>
8383
<PlatformTarget>x64</PlatformTarget>
8484
<UseVSHostingProcess>false</UseVSHostingProcess>
8585
<ErrorReport>prompt</ErrorReport>
8686
<Prefer32Bit>true</Prefer32Bit>
8787
</PropertyGroup>
8888
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
89-
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
89+
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UAP</DefineConstants>
9090
<Optimize>true</Optimize>
9191
<DebugType>pdbonly</DebugType>
9292
<PlatformTarget>x64</PlatformTarget>

Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="MSBuild.NET.Extras.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>uap10.0.17763</TargetFrameworks>

Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="MSBuild.NET.Extras.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>uap10.0.17763</TargetFrameworks>

Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.Uwp.Input.GazeInteraction.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="MSBuild.NET.Extras.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>uap10.0.17134</TargetFrameworks>

Microsoft.Toolkit.Uwp.Notifications/Badges/BadgeGlyphContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if WINDOWS_UWP
6+
#if WINDOWS_UAP
77
using Windows.Data.Xml.Dom;
88
#endif
99

@@ -80,7 +80,7 @@ public override string ToString()
8080
return GetContent();
8181
}
8282

83-
#if WINDOWS_UWP
83+
#if WINDOWS_UAP
8484
/// <summary>
8585
/// Retrieves the notification XML content as a WinRT Xml document.
8686
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Badges/BadgeNumericContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66
using Windows.Data.Xml.Dom;
77
#endif
88

@@ -62,7 +62,7 @@ public override string ToString()
6262
return GetContent();
6363
}
6464

65-
#if WINDOWS_UWP
65+
#if WINDOWS_UAP
6666
/// <summary>
6767
/// Retrieves the notification Xml content as a WinRT Xml document.
6868
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Common/BaseElement.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.IO;
66
using System.Text;
77

8-
#if WINDOWS_UWP
8+
#if WINDOWS_UAP
99
using Windows.Data.Xml.Dom;
1010
#endif
1111

@@ -40,7 +40,7 @@ public string GetContent()
4040
}
4141
}
4242

43-
#if WINDOWS_UWP
43+
#if WINDOWS_UAP
4444
/// <summary>
4545
/// Retrieves the notification XML content as a WinRT XML document.
4646
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Common/INotificationContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66
using Windows.Data.Xml.Dom;
77
#endif
88

@@ -19,7 +19,7 @@ public interface INotificationContent
1919
/// <returns>The notification Xml content as a string.</returns>
2020
string GetContent();
2121

22-
#if WINDOWS_UWP
22+
#if WINDOWS_UAP
2323
/// <summary>
2424
/// Retrieves the notification Xml content as a WinRT Xml document.
2525
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Common/LimitedList{T}.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System;
66
using System.Collections;
77
using System.Collections.Generic;
8-
#if WINDOWS_UWP
8+
#if WINDOWS_UAP
99

1010
#endif
1111

Microsoft.Toolkit.Uwp.Notifications/Common/NotificationContentValidationException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if WINDOWS_UWP
6+
#if WINDOWS_UAP
77

88
#endif
99

Microsoft.Toolkit.Uwp.Notifications/Common/NotificationXmlAttributeAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if WINDOWS_UWP
6+
#if WINDOWS_UAP
77

88
#endif
99

Microsoft.Toolkit.Uwp.Notifications/Common/NotificationXmlContentAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if WINDOWS_UWP
6+
#if WINDOWS_UAP
77

88
#endif
99

Microsoft.Toolkit.Uwp.Notifications/Common/NotificationXmlElementAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if WINDOWS_UWP
6+
#if WINDOWS_UAP
77

88
#endif
99

Microsoft.Toolkit.Uwp.Notifications/Common/XmlWriterHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Linq;
99
using System.Reflection;
1010

11-
#if WINDOWS_UWP
11+
#if WINDOWS_UAP
1212

1313
#endif
1414

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="MSBuild.NET.Extras.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard1.4;uap10.0.16299;net461;netcoreapp3.1;net5.0;net5.0-windows10.0.17763;native</TargetFrameworks>
@@ -14,8 +14,8 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.Contains('windows10.0'))">
17-
<!-- Define the WINDOWS_UWP conditional symbol, since the 'Windows.Data.Xml' and the 'Windows.UI.Notification' namespaces are available -->
18-
<DefineConstants>$(DefineConstants);WINDOWS_UWP;WIN32</DefineConstants>
17+
<!-- Define the WINDOWS_UAP conditional symbol, since the 'Windows.Data.Xml' and the 'Windows.UI.Notification' namespaces are available -->
18+
<DefineConstants>$(DefineConstants);WINDOWS_UAP;WIN32</DefineConstants>
1919
</PropertyGroup>
2020

2121
<PropertyGroup Condition="'$(TargetFramework)' == 'native'">
@@ -30,7 +30,7 @@
3030
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
3131
<!-- Misc -->
3232
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
33-
<DefineConstants>$(DefineConstants);WINDOWS_UWP;WINRT</DefineConstants>
33+
<DefineConstants>$(DefineConstants);WINDOWS_UAP;WINRT</DefineConstants>
3434
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
3535
<!-- Workaround for issue NuGet/Home#8388; Restore conflict in VS IDE 2019 during DesignTime vs BuildTime. -->
3636
<NuGetTargetMoniker Condition="'$(DesignTimeBuild)' != 'true'">UAP,Version=v10.0</NuGetTargetMoniker>
@@ -58,10 +58,6 @@
5858
<PackageReference Include="System.Drawing.Common" />
5959
</ItemGroup>
6060

61-
<ItemGroup Condition="'$(TargetFramework)' == 'native'">
62-
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" PrivateAssets="All" />
63-
</ItemGroup>
64-
6561
<!-- Native (C++) does not need 'System.ValueTuple' (plus it is incompatible with this package) -->
6662
<ItemGroup Condition="'$(TargetFramework)' != 'native'">
6763
<PackageReference Include="System.ValueTuple" />

Microsoft.Toolkit.Uwp.Notifications/ReadMe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Welcome to the Notifications section of the toolkit! This contains the Notificat
66

77
Any code for generating notifications should be written in the `Microsoft.Toolkit.Uwp.Notifications` project.
88

9-
If there's UWP-specific code, use the appropriate `#ifdef`, `WINDOWS_UWP` or `WINRT`.
9+
If there's UWP-specific code, use the appropriate `#ifdef`, `WINDOWS_UAP` or `WINRT`.
1010

1111
## What are all the projects for?
1212

Microsoft.Toolkit.Uwp.Notifications/Tiles/TileContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66
using Windows.Data.Xml.Dom;
77
using Windows.UI.Notifications;
88
#endif
@@ -28,7 +28,7 @@ public string GetContent()
2828
return ConvertToElement().GetContent();
2929
}
3030

31-
#if WINDOWS_UWP
31+
#if WINDOWS_UAP
3232
/// <summary>
3333
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Tile notification's constructor on either <see cref="TileNotification"/> or <see cref="ScheduledTileNotification"/>.
3434
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Toasts/Builder/CustomizeToast.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66

77
using Windows.Foundation;
88
using Windows.UI.Notifications;

Microsoft.Toolkit.Uwp.Notifications/Toasts/Builder/ToastContentBuilder.Visuals.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Linq;
88
using System.Text;
99

10-
#if WINDOWS_UWP
10+
#if WINDOWS_UAP
1111
using Windows.UI.Notifications;
1212
#endif
1313

@@ -79,7 +79,7 @@ private IList<IToastBindingGenericChild> VisualChildren
7979
}
8080
}
8181

82-
#if WINDOWS_UWP
82+
#if WINDOWS_UAP
8383
#if !WINRT
8484
/// <summary>
8585
/// Create an instance of NotificationData that can be used to update toast that has a progress bar.

Microsoft.Toolkit.Uwp.Notifications/Toasts/Builder/ToastContentBuilder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public ToastContent GetToastContent()
396396
return Content;
397397
}
398398

399-
#if WINDOWS_UWP
399+
#if WINDOWS_UAP
400400
/// <summary>
401401
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Toast notification's constructor on either <see cref="Windows.UI.Notifications.ToastNotification"/> or <see cref="Windows.UI.Notifications.ScheduledToastNotification"/>.
402402
/// </summary>

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/ToastNotificationHistoryCompat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66

77
using System.Collections.Generic;
88
using Windows.UI.Notifications;

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/ToastNotificationManagerCompat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66

77
using System;
88
using System.Collections.Generic;

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/ToastNotifierCompat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if WINDOWS_UWP
5+
#if WINDOWS_UAP
66

77
using System.Collections.Generic;
88
using Windows.UI.Notifications;

Microsoft.Toolkit.Uwp.Notifications/Toasts/ToastContent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using System;
66
using System.Collections.Generic;
7-
#if WINDOWS_UWP
7+
#if WINDOWS_UAP
88
using Windows.Data.Xml.Dom;
99
using Windows.UI.Notifications;
1010
#endif
@@ -100,7 +100,7 @@ public string GetContent()
100100
return ConvertToElement().GetContent();
101101
}
102102

103-
#if WINDOWS_UWP
103+
#if WINDOWS_UAP
104104

105105
/// <summary>
106106
/// Retrieves the notification XML content as a WinRT XmlDocument, so that it can be used with a local Toast notification's constructor on either <see cref="ToastNotification"/> or <see cref="ScheduledToastNotification"/>.

0 commit comments

Comments
 (0)