11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks >
4+ <TargetFrameworks >netstandard2.0;netstandard2.1;net6.0;net8.0;net8.0-windows10.0.17763.0</TargetFrameworks >
5+ </PropertyGroup >
6+
7+ <!--
8+ Windows-only properties (supporting AOT in WinRT scenarios requires actually using the Windows TFM,
9+ because we need the source generators in CsWinRT to generate the supporting interop code for AOT).
10+ -->
11+ <PropertyGroup Condition =" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))" >
12+ <WindowsSdkPackageVersion >10.0.17763.39</WindowsSdkPackageVersion >
13+
14+ <!--
15+ We're only referencing CsWinRT for the source generators, we don't need to read any WinRT metadata.
16+ CsWinRT is in projection mode by default, so we want to disable it (or it'd need the Windows SDK).
17+ -->
18+ <CsWinRTGenerateProjection >false</CsWinRTGenerateProjection >
19+
20+ <!-- Enable AOT warnings for types implementing projected WinRT interfaces mapped to built-in types (eg. 'INotifyPropertyChanged') -->
21+ <CsWinRTAotWarningLevel >2</CsWinRTAotWarningLevel >
522 </PropertyGroup >
623
724 <PropertyGroup >
3451 <PackageReference Include =" System.Runtime.CompilerServices.Unsafe" Version =" 6.0.0" />
3552 </ItemGroup >
3653
54+ <!-- Reference CsWinRT when targeting Windows, to get the latest source generators -->
55+ <ItemGroup Condition =" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0-windows10.0.17763.0'))" >
56+ <PackageReference Include =" Microsoft.Windows.CsWinRT" Version =" 2.1.0-prerelease.240801.1" PrivateAssets =" all" />
57+ </ItemGroup >
58+
3759 <!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version), and the code fixer -->
3860 <ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2.0'" >
3961 <ProjectReference Include =" ..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" ReferenceOutputAssembly =" false" />
87109 <None Include =" ..\CommunityToolkit.Mvvm.CodeFixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath =" analyzers\dotnet\roslyn4.0\cs" Pack =" true" Visible =" false" />
88110 <None Include =" ..\CommunityToolkit.Mvvm.CodeFixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.CodeFixers.dll" PackagePath =" analyzers\dotnet\roslyn4.3\cs" Pack =" true" Visible =" false" />
89111 </ItemGroup >
90-
91112</Project >
0 commit comments