I am trying to publish an application on cross platform i.e, on mac and Windows. I successfully developed and deployed for mac but when I publish and deploy it for win-x64 (Windows), the application opens but there's command prompt in background and I need to fix that.

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<PublishTrimmed> true </PublishTrimmed>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
<SelfContained>true</SelfContained>
<ApplicationIcon>CompcastApplication.ico</ApplicationIcon>
<Version>1.0.0</Version>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<PropertyGroup>
<CFBundleName>EnvironmentSetter</CFBundleName>
<CFBundleExecutable>EnvironmentSetter</CFBundleExecutable>
<CFBundleIdentifier>com.gani.comcomcastapp</CFBundleIdentifier>
<CFBundleShortVersionString>$(Version)</CFBundleShortVersionString>
<CFBundleIconFile>Comcast.icns</CFBundleIconFile>
<CFBundlePackageType>APPL</CFBundlePackageType>
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>True</NSHighResolutionCapable>
<NSHumanReadableCopyright>©2023 Ganiiiii</NSHumanReadableCopyright>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.Themes.Fluent" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="DotNet.Bundle" Version="0.9.13" />
<PackageReference Include="MessageBox.Avalonia" Version="2.1.0" />
<PackageReference Include="NSubsys" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<NoWin32Manifest>true</NoWin32Manifest>
</ItemGroup>
</Project>
I tried using this and I tried using runtime identifiers as well but the command prompt won't go away.