Skip to content

EFCore (7.0) in MAUI (.NET 7) - first query in Release mode always throws error (Android) #29589

@jovanmhn

Description

@jovanmhn

Description

When using EFCore and building the app in Release mode, the first query that returns any result, will throw an exception "Could not load file or assembly 'System.Runtime.Caching'... or one of its dependencies"
Every subsequent query works fine, and building the app in Debug mode works fine as well.

video_2022-11-16_11-55-22.mp4

Steps to Reproduce

  1. Create MAUI app, add the EFCore packages, try to read a row from a SQL database in Release mode

or take the repo, modify it so it reads any data from any sql database (as far as I am aware, you have to embed the .cer file that is used on the sql server, or install it onto the testing device)

Press the bottom button once for error, twice for success

Link to public reproduction project repository

https://github.com/jovanmhn/EFCoreTest

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12 API 31

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions