-
Notifications
You must be signed in to change notification settings - Fork 564
Open
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.Area: NativeAOTIssues that only occur when using NativeAOT.Issues that only occur when using NativeAOT.
Milestone
Description
Versions
net10.0
android 36.1
VS2026 18.0.2
Description
When deploying to android emulator from VS2026 a dotnet maui app built with PublishAot=true, I get an exception, not always but most of the time.
Steps to Reproduce
- dotnet new maui -n TestNativeAot
- add
<PublishAot>true</PublishAot>to csproj - build and deploy to android emulator (release configuration)
Did you find any workaround?
I've tried to delete obj/bin folders, killed adb and msbuild, reboot my machine.
I've also added <RuntimeIdentifiers>android-x64</RuntimeIdentifiers> to the csproj to make sure vs builds only for 1 rid... but I'm not sure it works.
No matter what I do, the exception is raised most of the time.
Relevant log output
IL1011: Failed to write 'obj\Release\net10.0-android36.1\android-x64\linked\Java.Interop.dll'.
Fatal error in IL Linker
Unhandled exception. Mono.Linker.LinkerFatalErrorException: ILLink: error IL1011: Failed to write 'obj\Release\net10.0-android36.1\android-x64\linked\Java.Interop.dll'.
---> System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open. : 'obj\Release\net10.0-android36.1\android-x64\linked\Java.Interop.dll'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.GetFileStream(String fileName, FileMode mode, FileAccess access, FileShare share)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Cecil.AssemblyDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
--- End of inner exception stack trace ---
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory)
at Mono.Linker.Steps.OutputStep.OutputAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.OutputStep.ProcessAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Mono.Linker.Driver.Run(ILogger customLogger)
at Mono.Linker.Driver.Main(String[] args)Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.Area: NativeAOTIssues that only occur when using NativeAOT.Issues that only occur when using NativeAOT.