Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit d23401c

Browse files
committed
Add DISABLE_XAML_GENERATED_MAIN
1 parent 8ad71b1 commit d23401c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Samples.MauiApp1/Samples.MauiApp1.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
2929
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
3030
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
31-
31+
3232
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
3333
<!-- Samples.MauiApp1.csproj : error NU1009: 已隐式引用包 Microsoft.Windows.SDK.BuildTools 。通常无需从项目或中央包版本管理文件中引用它们。有关详细信息,请参 阅 https://aka.ms/sdkimplicitrefs -->
34-
35-
<StartupObject Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">Samples.MauiApp1.MauiProgram</StartupObject>
34+
</PropertyGroup>
35+
36+
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
37+
<StartupObject>Samples.MauiApp1.MauiProgram</StartupObject>
38+
<DefineConstants>DISABLE_XAML_GENERATED_MAIN;$(DefineConstants)</DefineConstants>
3639
</PropertyGroup>
3740

3841
<ItemGroup>

Samples.WinUI3App1/Samples.WinUI3App1.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
44
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
@@ -12,6 +12,7 @@
1212
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
1313
<WindowsPackageType>None</WindowsPackageType>
1414
<StartupObject>Samples.WinUI3App1.WinUIProgram</StartupObject>
15+
<DefineConstants>DISABLE_XAML_GENERATED_MAIN;$(DefineConstants)</DefineConstants>
1516
</PropertyGroup>
1617

1718
<ItemGroup>

0 commit comments

Comments
 (0)