.net Maui Deploy to Android in release produces "module is unusable (GUID of dependent assembly Microsoft.EntityFrameworkCore.Sqlite doesn't match"

Julian Dormon 6 Reputation points
2022-09-27T14:23:26.303+00:00

I am building a .net Maui Android app. I have no problem deploying my app to an Android emulator or real device when in Debug mode. However if I deploy in Release mode, the app crashes on load. The android device log, shows the following error,

Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3678, condition `is_ok (error)' not met, function:decode_patch, module is unusable (GUID of dependent assembly Microsoft.EntityFrameworkCore.Sqlite doesn't match (expected 'DE191E13-E625-494C-862B-66ABDC9BC3C8', got '0C0A2DB6-8411-4D35-912B-740A5B7BC5CE')).

I had no problem running this in Release mode earlier in the development cycle. I have updated both Visual Studio and Microsoft.EntityFrameworkCore.Sqlite probably several times since I last tested in Release mode.

My project does reference a DbClassLibrary. Both projects reference the same version of Microsoft.EntityFrameworkCore.Sqlite, 6.0.9 which is the latest at the time of writing.

I have tried deleting the App from the Android device, cleaned my solution and re-published.

My Visual Studio specs are as follows:

Visual Studio Community 2022 for Mac Preview Version 17.4 Preview (17.4 build 1583) Installation UUID: 10e52aa0-ff80-4b74-8350-1c794fdcca3c

Runtime .NET 6.0.5 (64-bit) Architecture: Arm64

Roslyn (Language Service) 4.4.0-2.22419.1+ae5663806be933515723b2d5a85faf5d378f460d

NuGet Version: 6.3.0.128

.NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/6.0.401/Sdks SDK Versions: 6.0.401 6.0.400 6.0.400-preview.22330.6 MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64) SDK Versions: 5.0.408 3.1.423 3.1.422 3.1.421

.NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 6.0.9 6.0.8 6.0.6

.NET Runtime (x64) Runtime: /usr/local/share/dotnet/x64/dotnet Runtime Versions: 5.0.17 3.1.29 3.1.28 3.1.27

Xamarin.Profiler Version: 1.8.0.19 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater Version: 11 ...

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,693 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,861 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Tyson Swing 1 Reputation point
    2022-09-28T05:35:17+00:00

    Confirmed there is something wrong with latest Visual Studio update. Just yesterday 2022-09-26 my app built in release mode deployed to a physical device worked. As soon as VS update, release build no longer works with the following error:

    module is unusable GUID of dependent assembly Microsoft.Maui doesn't match expected BF439B92-AABA-4CDA-BC93-F05A69484D20 995F4EB1-CF87-459A-85C1-A7632CF609E3

    0 comments No comments

  2. Elmar Beck 0 Reputation points
    2023-02-18T23:03:10.5566667+00:00

    Similar error with me: "GUID of dependent assembly Microsoft.Maui.Controls.Maps doesn't match ..."

    0 comments No comments

  3. Elmar Beck 0 Reputation points
    2023-02-19T18:54:07.3333333+00:00

    I deleted the /bin and /obj folders and rebuilt the app. That solved the problem.

    0 comments No comments