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

.NET9 MAUI sample App build crash on C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7) #44919

Open
Pipozor opened this issue Nov 18, 2024 · 7 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@Pipozor
Copy link

Pipozor commented Nov 18, 2024

Describe the bug

Impossible to build MAUI .NET9 default sample project in RELEASE for some (or all?) platforms.

Remark : it was working in DEBUG build (past 3 days) but today not working in DEBUG too!!

To Reproduce

Simply create a new MAUI .NET9 with the sample project checked.
Build in Release for windows/ios/android platforms.

Exception

Image

Further technical details

Visual Studio 17.12.0 or Visual Studio 17.13.0.Preview 1

Image

  • I tried to repair Visual Studio installation -> same error
  • I reinstalled Visual Studio from scratch -> same error
  • I tried to resave the file C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets
    in case of some UTF8 etc... but it is clean and ANSI.

It seems to be more an internal issue!?

1>------ Build started: Project: LiDi.MobileApp, **Configuration: Release Any CPU** ------ 1>LiDi.MobileApp -> D:\Projects\LiDi\LiDi-master-net9\LiDi.MobileApp\bin\Release\net9.0-ios\iossimulator-x64\LiDi.MobileApp.dll 1>LiDi.MobileApp -> D:\Projects\LiDi\LiDi-master-net9\LiDi.MobileApp\bin\Release\net9.0-android\LiDi.MobileApp.dll 1>LiDi.MobileApp -> D:\Projects\LiDi\LiDi-master-net9\LiDi.MobileApp\bin\Release\net9.0-maccatalyst\maccatalyst-x64\LiDi.MobileApp.dll 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: The "ResolveRuntimePackAssets" task failed unexpectedly. 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1. 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.XmlTextReaderImpl.Throw(Exception e) 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos) 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.XmlTextReaderImpl.ParseDocumentContent() 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveRuntimePackAssets.AddRuntimePackAssetsFromManifest(List1 runtimePackAssets, String runtimePackRoot, String runtimeListPath, ITaskItem runtimePack, Boolean runtimePackAlwaysCopyLocal, HashSet1 profiles) 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveRuntimePackAssets.ExecuteCore() 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() 1>C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() 1>Done building project "LiDi.MobileApp.csproj" -- FAILED. 1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink 1>Optimizing assemblies for size. This process might take a while.

  • If it helps to analyse : a similar issue raised in May 6th 2024 here
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Nov 18, 2024
@Pipozor Pipozor changed the title .NET 9 Release build crash on C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7) .NET9 MAUI sample App build crash on C:\Program Files\dotnet\sdk\9.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(494,7) Nov 18, 2024
@marcpopMSFT
Copy link
Member

@Redth @jonathanpeppers seen this before?

@jonathanpeppers
Copy link
Member

I would guess this file is malformed?

var runtimeListPath = Path.Combine(runtimePackRoot, "data", "RuntimeList.xml");

But the error message doesn't contain the file path to easily check. You could handle XmlException and put the file path in the MSBuild error, but maybe that is overkill.

@Redth
Copy link
Member

Redth commented Nov 18, 2024

My guess is it's related to: dotnet/maui#25832

@Pipozor
Copy link
Author

Pipozor commented Nov 19, 2024

Thank you for replies.

I uninstalled visual studio, dotnet 8 and 9 SDK.

I don't know if related to the issue, but when :

  • I reinstalled Visual Studio 2022 (latest).
  • reinstalled Dotnet 8 SDK (dotnet-sdk-8.0.404-win-x64.exe + dotnet-runtime-8.0.11-win-x64.exe)
  • dotnet workload update (in admin cmd), I got some failed :

Image

Then :

  • I installed dotnet 9 SDK from dotnet-sdk-9.0.100-win-x64.exe + dotnet-runtime-9.0.0-win-x64.exe
  • dotnet workload list :

---> A problem appeared in yellow (see screenshot :)
Image

Then, I am doing :

  • dotnet workload update

Same issue :(

Image

@Pipozor
Copy link
Author

Pipozor commented Nov 19, 2024

Can Dot8 SDK & Dot9 SDK coexist?

After all actions above when doing:

dotnet workload list

I got only SDK 9 in the list; Like if SDK 8 was gone

Image

I tried some options, but same issues:

Image

With verbose mode detailed:

Image

@Pipozor
Copy link
Author

Pipozor commented Nov 19, 2024

I tried with dotnet workload restore
but same issue :(

Image

I noticed the errors occurs on a randomly, if I launch successive dotnet workload restore...

I tried specific workload_id to install, all failed :

Image

Some more detail with this command dotnet workload repair
It says "installation source of this product is no more available. Verify that source exists and you have access". !!!

Image

@Pipozor
Copy link
Author

Pipozor commented Nov 19, 2024

`**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.13.0-pre.1.0
** Copyright (c) 2022 Microsoft Corporation


PS C:\WINDOWS\system32> dotnet --info
SDK .NET :
Version: 9.0.100
Commit: 59db016
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\

Charges de travail .NET installées :
[android]
Source de l’installation: SDK 9.0.100, VS 17.13.35507.96
Version de manifeste: 35.0.7/9.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.7\WorkloadManifest.json
Type d'installation: Msi

[aspire]
Source de l’installation: SDK 9.0.100, VS 17.13.35507.96
Version de manifeste: 8.2.2/8.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
Type d'installation: Msi

[ios]
Source de l’installation: SDK 9.0.100, VS 17.13.35507.96
Version de manifeste: 18.0.9617/9.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.0.9617\WorkloadManifest.json
Type d'installation: Msi

[maccatalyst]
Source de l’installation: SDK 9.0.100, VS 17.13.35507.96
Version de manifeste: 18.0.9617/9.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.0.9617\WorkloadManifest.json
Type d'installation: Msi

[maui-windows]
Source de l’installation: SDK 9.0.100, VS 17.13.35507.96
Version de manifeste: 9.0.0/9.0.100
Chemin d'accès au Manifeste: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.0\WorkloadManifest.json
Type d'installation: Msi

Configuré pour utiliser loose manifests lors de l’installation de nouveaux manifestes.

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

.NET SDKs installed:
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants