Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression/8.0.0] New MAUI project template in .NET 8 is defining default svg files as AndroidResource #17993

Closed
1 task
anotherlab opened this issue Oct 13, 2023 · 10 comments
Labels
area-templates Project templates, Item Templates for Blazor and MAUI area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working

Comments

@anotherlab
Copy link

anotherlab commented Oct 13, 2023

Description

When you create a new .NET MAUI project using File ->New with .NET 8 RC2 the default images are defined as AndroidResource instead of MauiIcon, MauiSplashScreen or MauiImage

Expected outcome:

<ItemGroup>
	<!-- App Icon -->
	<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
	<MauiImage Include="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

	<!-- Splash Screen -->
	<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

	<!-- Images -->
	<MauiImage Include="Resources\Images\*" />

	<!-- Custom Fonts -->
	<MauiFont Include="Resources\Fonts\*" />

	<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
	<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

Actual outcome:

<ItemGroup>
	<!-- App Icon -->
	<AndroidResource Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
	<AndroidResource Include="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

	<!-- Splash Screen -->
	<AndroidResource Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

	<!-- Images -->
	<MauiImage Include="Resources\Images\*" />

	<!-- Custom Fonts -->
	<MauiFont Include="Resources\Fonts\*" />

	<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
	<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

Steps to Reproduce

  1. Create a new project using File -> New
  2. Open the project file as code
  3. Look at the svg files in the first ItemGroup

Link to public reproduction project repository

N/A

Version with bug

8.0.0-rc.2.9373

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

7.0.96

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

Not platform specific

Did you find any workaround?

Manually Replace the AndroidResource references in the csproj file with the correct references.

Relevant log output

No response

@anotherlab anotherlab added the t/bug Something isn't working label Oct 13, 2023
@Eilon Eilon added the area-templates Project templates, Item Templates for Blazor and MAUI label Oct 13, 2023
@mattleibow mattleibow removed the area-templates Project templates, Item Templates for Blazor and MAUI label Oct 13, 2023
@jsuarezruiz jsuarezruiz added the area-templates Project templates, Item Templates for Blazor and MAUI label Oct 16, 2023
@samhouts samhouts added area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging potential-regression This issue described a possible regression on a currently supported version., verification pending labels Oct 16, 2023
@samhouts samhouts added this to the .NET 8 GA milestone Oct 16, 2023
@samhouts samhouts changed the title New MAUI project template in .NET 8 is defining default svg files as AndroidResource [regression/8.0.0] New MAUI project template in .NET 8 is defining default svg files as AndroidResource Oct 17, 2023
@moljac
Copy link
Contributor

moljac commented Oct 17, 2023

Cannot repro!

On Mac dotnet CLI

dotnet new maui -o aaa

result

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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);net8.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 <RuntimeIdentifer>.
		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>aaa</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>aaa</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>com.companyname.aaa</ApplicationId>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</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>
	</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.svg" BaseSize="168,208" />

		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6" />
	</ItemGroup>

	<!-- Build Properties must be defined within these property groups to ensure successful publishing
       to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
  </PropertyGroup>

  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
    <UseHardenedRuntime>true</UseHardenedRuntime>
  </PropertyGroup>
</Project>

dotnet info dump:

==============================================================================================================
  Microsoft .NET 
  

  dotnet --info
  
.NET SDK:
 Version:   8.0.100-rc.2.23502.2
 Commit:    0abacfc2b6

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.0
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.100-rc.2.23502.2/

.NET workloads installed:
 [wasm-tools]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.23479.6/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.workload.mono.toolchain.current/8.0.0-rc.2.23479.6/WorkloadManifest.json
   Install Type:        FileBased

 [maui-windows]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [macos]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    13.3.8968-net8-rc2/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.macos/13.3.8968-net8-rc2/WorkloadManifest.json
   Install Type:        FileBased

 [maui-maccatalyst]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [maui-ios]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [maui-android]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    16.4.8968-net8-rc2/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.ios/16.4.8968-net8-rc2/WorkloadManifest.json
   Install Type:        FileBased

 [maui-mobile]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [maccatalyst]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    16.4.8968-net8-rc2/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maccatalyst/16.4.8968-net8-rc2/WorkloadManifest.json
   Install Type:        FileBased

 [maui]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    8.0.0-rc.2.9373/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.maui/8.0.0-rc.2.9373/WorkloadManifest.json
   Install Type:        FileBased

 [tvos]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    16.4.8968-net8-rc2/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.tvos/16.4.8968-net8-rc2/WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: SDK 8.0.100-rc.2
   Manifest Version:    34.0.0-rc.2.468/8.0.100-rc.2
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100-rc.2/microsoft.net.sdk.android/34.0.0-rc.2.468/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.0-rc.2.23479.6
  Architecture: x64
  Commit:       0b25e38ad3

.NET SDKs installed:
  6.0.116 [/usr/local/share/dotnet/sdk]
  6.0.123 [/usr/local/share/dotnet/sdk]
  6.0.311 [/usr/local/share/dotnet/sdk]
  6.0.318 [/usr/local/share/dotnet/sdk]
  6.0.408 [/usr/local/share/dotnet/sdk]
  6.0.410 [/usr/local/share/dotnet/sdk]
  6.0.412 [/usr/local/share/dotnet/sdk]
  6.0.414 [/usr/local/share/dotnet/sdk]
  6.0.415 [/usr/local/share/dotnet/sdk]
  7.0.105 [/usr/local/share/dotnet/sdk]
  7.0.111 [/usr/local/share/dotnet/sdk]
  7.0.112 [/usr/local/share/dotnet/sdk]
  7.0.203 [/usr/local/share/dotnet/sdk]
  7.0.302 [/usr/local/share/dotnet/sdk]
  7.0.304 [/usr/local/share/dotnet/sdk]
  7.0.306 [/usr/local/share/dotnet/sdk]
  7.0.309 [/usr/local/share/dotnet/sdk]
  7.0.401 [/usr/local/share/dotnet/sdk]
  7.0.402 [/usr/local/share/dotnet/sdk]
  8.0.100-preview.7.23376.3 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.1.23463.5 [/usr/local/share/dotnet/sdk]
  8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-preview.7.23375.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.7.23375.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

  dotnet --list-runtimes
  
Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.7.23375.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-rc.1.23421.29 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.18 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.23 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.12 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.7.23375.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-rc.1.23419.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

  dotnet --list-sdks
  
6.0.116 [/usr/local/share/dotnet/sdk]
6.0.123 [/usr/local/share/dotnet/sdk]
6.0.311 [/usr/local/share/dotnet/sdk]
6.0.318 [/usr/local/share/dotnet/sdk]
6.0.408 [/usr/local/share/dotnet/sdk]
6.0.410 [/usr/local/share/dotnet/sdk]
6.0.412 [/usr/local/share/dotnet/sdk]
6.0.414 [/usr/local/share/dotnet/sdk]
6.0.415 [/usr/local/share/dotnet/sdk]
7.0.105 [/usr/local/share/dotnet/sdk]
7.0.111 [/usr/local/share/dotnet/sdk]
7.0.112 [/usr/local/share/dotnet/sdk]
7.0.203 [/usr/local/share/dotnet/sdk]
7.0.302 [/usr/local/share/dotnet/sdk]
7.0.304 [/usr/local/share/dotnet/sdk]
7.0.306 [/usr/local/share/dotnet/sdk]
7.0.309 [/usr/local/share/dotnet/sdk]
7.0.401 [/usr/local/share/dotnet/sdk]
7.0.402 [/usr/local/share/dotnet/sdk]
8.0.100-preview.7.23376.3 [/usr/local/share/dotnet/sdk]
8.0.100-rc.1.23463.5 [/usr/local/share/dotnet/sdk]
8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk]
--------------------------------------------------------------------------------------------------------------

  dotnet workload list
  

Installed Workload Id      Manifest Version                     Installation Source
-----------------------------------------------------------------------------------
wasm-tools                 8.0.0-rc.2.23479.6/8.0.100-rc.2      SDK 8.0.100-rc.2   
maui-windows               8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
macos                      13.3.8968-net8-rc2/8.0.100-rc.2      SDK 8.0.100-rc.2   
maui-maccatalyst           8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
maui-ios                   8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
maui-android               8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
ios                        16.4.8968-net8-rc2/8.0.100-rc.2      SDK 8.0.100-rc.2   
maui-mobile                8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
maccatalyst                16.4.8968-net8-rc2/8.0.100-rc.2      SDK 8.0.100-rc.2   
maui                       8.0.0-rc.2.9373/8.0.100-rc.2         SDK 8.0.100-rc.2   
tvos                       16.4.8968-net8-rc2/8.0.100-rc.2      SDK 8.0.100-rc.2   
android                    34.0.0-rc.2.468/8.0.100-rc.2         SDK 8.0.100-rc.2   

Use `dotnet workload search` to find additional workloads to install.

Windows VS 17.8

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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);net8.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 <RuntimeIdentifer>.
		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>MauiApp1</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>MauiApp1</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>com.companyname.mauiapp1</ApplicationId>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</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>
	</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.svg" BaseSize="168,208" />

		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6" />
	</ItemGroup>

	<!-- Build Properties must be defined within these property groups to ensure successful publishing
       to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
  </PropertyGroup>

  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
    <UseHardenedRuntime>true</UseHardenedRuntime>
  </PropertyGroup>
</Project>

windows dotnet CLI

dotnet new maui -o aaa

result:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.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);net8.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 <RuntimeIdentifer>.
		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>aaa</RootNamespace>
		<UseMaui>true</UseMaui>
		<SingleProject>true</SingleProject>
		<ImplicitUsings>enable</ImplicitUsings>

		<!-- Display name -->
		<ApplicationTitle>aaa</ApplicationTitle>

		<!-- App Identifier -->
		<ApplicationId>com.companyname.aaa</ApplicationId>

		<!-- Versions -->
		<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
		<ApplicationVersion>1</ApplicationVersion>

		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
		<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</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>
	</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.svg" BaseSize="168,208" />

		<!-- Custom Fonts -->
		<MauiFont Include="Resources\Fonts\*" />

		<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
		<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
		<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6" />
	</ItemGroup>

	<!-- Build Properties must be defined within these property groups to ensure successful publishing
       to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
  </PropertyGroup>

  <PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
    <CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
    <UseHardenedRuntime>true</UseHardenedRuntime>
  </PropertyGroup>
</Project>

@Redth Redth added partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with and removed partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with labels Oct 25, 2023
@Redth Redth modified the milestones: .NET 8 GA, .NET 8 SR1 Oct 25, 2023
@Redth
Copy link
Member

Redth commented Oct 25, 2023

I can't repro this either. The only thing I can think of that would cause this is accidentally selecting the items in the solution explorer and inadvertently changing the build action of them?

@Redth Redth added s/needs-repro Attach a solution or code which reproduces the issue and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Oct 25, 2023
@ghost
Copy link

ghost commented Oct 25, 2023

Hi @anotherlab. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@anotherlab
Copy link
Author

I've had it happen three times when creating new MAUI projects. I can not reliably reproduce it right now. I was not selecting the items in the solution explorer and changing the build action. I would say close it for now and when I find the steps to reproduce it each time, I'll open a new issue and add a screen recording.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Oct 25, 2023
@Redth Redth modified the milestones: .NET 8 SR1, .NET 8 SR3 Nov 30, 2023
@samhouts samhouts added the potential-regression This issue described a possible regression on a currently supported version., verification pending label Dec 6, 2023
@notoriousxl
Copy link

notoriousxl commented Dec 12, 2023

This happened to me as well, both on a preexisting project recently converted to .NET 8 and when creating a new project; I think yesterday happened once after reopening the solution with Visual Studio, but it's totally non-deterministic.

In my case the bug converted also MauiFont to AndroidResource, adding the following lines:

<ItemGroup>
	  <MauiFont Remove="Resources\Fonts\OpenSansRegular.ttf" />
	  <MauiFont Remove="Resources\Fonts\OpenSansSemibold.ttf" />
</ItemGroup>
<ItemGroup>
	  <AndroidResource Include="Resources\Fonts\OpenSansRegular.ttf" />
	  <AndroidResource Include="Resources\Fonts\OpenSansSemibold.ttf" />
</ItemGroup>

I'm using Visual Studio 2022 64-bit 17.8.3.

@AlleSchonWeg
Copy link
Contributor

This happens to me as well. I tried to create a repro, but without success. I have added a custom font, some images and styles in the resources folder. I also added in the android platform resources folder a png (created drawable folder), created a xml folder for essentials backup rules and apply the rules in the androidmanifest.xml. (Setting build action to AndroidResource)
I get errors if i delete the obj/bin folders via explorer and then rebuild, because VS changed the MAUI Build Actions:
image

@PureWeen PureWeen modified the milestones: .NET 8 SR3, Backlog Jan 10, 2024
@ghost
Copy link

ghost commented Jan 10, 2024

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@anotherlab
Copy link
Author

This is still happening, but non-deterministic. But it happens enough to be an annoyance.

Open Visual Studio
File, New, Project
Select .NET MAUI App
Provide name and path for the project
Select .NET 8 for the framework
Then press the create button

The project opens up and you immediately see the Red Squiggle of Unhappiness ™️ on the Resources folder.
Open up the .csproj and the app icon and the splash screen are both defined as AndroidResource instead MauiIcon and MauiSplashScreen

I just did this twice in a row in two different folders. The first one was broken, the second one was fine.

The only change from when I first reported this is that I am now using Visual Studio 17.9.0 Preview 2.1, MAUI 8.0.100

Copy link
Contributor

Hi @anotherlab. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Zhanglirong-Winnie
Copy link

This issue has been verified using Visual Studio 17.12.0 Preview 1.0 (8.0.80 & 8.0.72)& 17.11.0 (8.0.72). Can not repro this issue.

@dotnet-policy-service dotnet-policy-service bot removed this from the Backlog milestone Aug 26, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in MAUI SDK Ongoing Aug 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-templates Project templates, Item Templates for Blazor and MAUI area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests