Skip to content

Can't run maui sample from maui repo on Visual Studio Preview #10042

Closed

Description

@rmarinho

Android framework version

net10.0-android (Preview)

Affected platform version

VS 17.14 Preview 2

Description

Trying to run sample apps from dotnet/maui repo with net10.0 is not working, it throws a error related with System.Memory.

binlogs

Maui.Controls.Sample.Sandbox_Debug_AnyCPU_net10.0-android_Build_2025-04-16T16_42_27.6234283+01_00.zip

Msbuild.exe.config

MSBuild.exe.zip

Steps to Reproduce

  • Clone dotnet/maui
  • dotnet cake --target=VS
  • Try to run Maui.Controls.Sample.Sandbox

Did you find any workaround?

No response

Relevant log output

System.IO.FileNotFoundException: Could not load file or assembly 'System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
   at Xamarin.Android.Tasks.MonoAndroidHelper.GetXxHash(Byte[] stringBytes, Boolean is64Bit)
   at Xamarin.Android.Tasks.ApplicationConfigNativeAssemblyGenerator.HashAndSortDSOCache(LlvmIrVariable variable, LlvmIrModuleTarget target, Object state) in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGenerator.cs:line 339
   at Xamarin.Android.Tasks.LLVMIR.LlvmIrGenerator.WriteGlobalVariables(GeneratorWriteContext context) in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs:line 255
   at Xamarin.Android.Tasks.LLVMIR.LlvmIrGenerator.Generate(TextWriter writer, LlvmIrModule module) in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs:line 176
   at Xamarin.Android.Tasks.LLVMIR.LlvmIrComposer.Generate(LlvmIrModule module, AndroidTargetArch arch, StreamWriter output, String fileName) in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrComposer.cs:line 42
   at Xamarin.Android.Tasks.GeneratePackageManagerJava.AddEnvironment() in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs:line 390
   at Xamarin.Android.Tasks.GeneratePackageManagerJava.RunTask() in /Users/runner/work/1/s/android/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs:line 136
   at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Activity

  1. added
    Area: App+Library Build
    needs-triage
    on Apr 16, 2025
  2. jonathanpeppers commented on Apr 16, 2025

    @jonathanpeppers
    Member

    The MSBuild.exe.config has:

          <dependentAssembly>
            <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
          </dependentAssembly>

    So, we have something that brings in 4.0.2.0, which won't work with .NET framework MSBuild yet.

  3. jonathanpeppers commented on Apr 16, 2025

    @jonathanpeppers
    Member

    Looks like this is caused by using .NET 10's System.IO.Hashing.

    We will need to use:

  4. locked and limited conversation to collaborators on May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library Buildneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions