Publishing MAUI Project on Windows: Grayed Out Option

Smith Tom 65 Reputation points
2024-10-05T14:00:54.4366667+00:00

I want to publish my MAUI project on the Windows platform, but the publishing option is grayed out. What steps can be taken to resolve this issue?

User's image

User's image

Here's my C# project configuration:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
		<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
		<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
		<!-- Note for MacCatalyst:
		The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
		When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
		The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
		either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
		<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
		<OutputType>Exe</OutputType>
		<RootNamespace>RumorsSearcher</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<!-- Display name -->
		<ApplicationTitle>RumorsSearcher</ApplicationTitle>
		<!-- App Identifier -->
		<ApplicationId>com.companyname.rumorssearcher</ApplicationId>
		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>
		<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
		<WindowsPackageType>None</WindowsPackageType>
    <WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
		<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
		<PublishAot>True</PublishAot>
	</PropertyGroup>
	<ItemGroup>
		<!-- App Icon -->
		<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
		<!-- Splash Screen -->
		<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
		<!-- Images -->
		<MauiImage Include="Resources\Images\*" />
		<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />
		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>
	<ItemGroup>
	  <None Remove="Resources\Images\node.png" />
	  <None Remove="Resources\Images\search.png" />
	  <None Remove="Resources\Images\setting.png" />
	</ItemGroup>
	<ItemGroup>
		<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
		<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
		<PackageReference Include="HtmlAgilityPack" Version="1.11.67" />
		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.1.24431.7" />
		<PackageReference Include="Selenium.WebDriver" Version="4.25.0" />
		<PackageReference Include="System.Drawing.Common" Version="9.0.0-rc.1.24451.1" />
		<PackageReference Include="XFEExtension.NetCore" Version="3.0.7" />
		<PackageReference Include="XFEExtension.NetCore.AutoConfig" Version="1.1.1" />
		<PackageReference Include="XFEExtension.NetCore.AutoImplement" Version="1.0.1" />
		<PackageReference Include="XFEExtension.NetCore.AutoPath" Version="1.0.1" />
		<PackageReference Include="XFEExtension.NetCore.TodoHighLight" Version="1.0.0" />
		<PackageReference Include="XFEExtension.NetCore.XFEConsole" Version="1.0.3" />
	</ItemGroup>
	<ItemGroup>
	  <MauiXaml Update="Resources\Theme\DarkTheme.xaml">
	    <Generator>MSBuild:Compile</Generator>
	  </MauiXaml>
	  <MauiXaml Update="Resources\Theme\LightTheme.xaml">
	    <Generator>MSBuild:Compile</Generator>
	  </MauiXaml>
	  <MauiXaml Update="Views\SettingPage.xaml">
	    <Generator>MSBuild:Compile</Generator>
	  </MauiXaml>
	</ItemGroup>
</Project>

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,595 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,011 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.