'MAUI Blazor Android Sql Connection

I am experimenting with Maui Blazor. I want to connect my application with an SQL server database. Therefore I used a simple Sql Connection String. When I test it with the "normal Windows machine" there are no problems but when I want to test it on the android emulator it is not working.

I used the "scaffold-DBContext .." command and have my connection string in the generated method:

...
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        if (!optionsBuilder.IsConfigured)
        {
             var sqlConnectionString = ...;
             //#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
            optionsBuilder.UseSqlServer(sqlConnectionString);
        }
...

What do I have to do that it is working on the android emulator? My breakpoints in the "OnConfiguring" method do not even get hit (with Android).

(And maybe someone does know why it is not working?)

Thank you very much in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source