Skip to content

Cannot Release To An Android Device On USB On New Install On Windows 11 #90307

@StephenWin

Description

@StephenWin

Description

I have had to move to a new laptop and can run my existing project in windows and on a USB attached android in debug mode with no issues. When I try to do a Release mode to the USB connected Android I get an error. I have now tried a new project and get the same error :

Severity	Code	Description	Project	File	Line	Suppression State
Error		Precompiling failed for D:\Dev\Software\MAUI\Test Apps\TestAppWin11V1\TestAppWin11V1\TestAppWin11V1\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll with exit code 1.
Error: Loaded assembly 'D:\Dev\Software\MAUI\Test Apps\TestAppWin11V1\TestAppWin11V1\TestAppWin11V1\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll' doesn't match original file name 'D:\DEV\SOFTWARE\MAUI\TEST APPS\TESTAPPWIN11V1\TESTAPPWIN11V1\TESTAPPWIN11V1\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll'. Set MONO_PATH to the assembly's location.	TestAppWin11V1	C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\targets\Microsoft.Android.Sdk.Aot.targets	91

So it seems the issue is the Windows 11 new install of VS2022 maybe but I have no idea what is needed to solve the problem ?

Reproduction Steps

Install VS2022 on Windows 11 Pro and start a new Maui Application. Try to do a Release mode onto a USB attached Android device.

Expected behavior

That is compiles and deploys the release mode project to the Android device.

Actual behavior

Fails with an error (See description)

Regression?

Works fine with the same set up on Windows 10 laptop

Known Workarounds

No response

Configuration

.net 7.0
Windows 11 Pro 22H2
x64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions