© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
46 replies
TheBasedTaka

❔ Entity Framework + Docker sql server on ubuntu

the error

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)

the code

using Microsoft.EntityFrameworkCore;
using cPizza.Models;

namespace cPizza.Data
{
    public class ApplicationDbContext : DbContext
    {
        public DbSet<PizzaOrder> PizzaOrders { get; set; }

        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
        {
            
        }
    }
}
using Microsoft.EntityFrameworkCore;
using cPizza.Models;

namespace cPizza.Data
{
    public class ApplicationDbContext : DbContext
    {
        public DbSet<PizzaOrder> PizzaOrders { get; set; }

        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
        {
            
        }
    }
}

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=172.17.0.2,1433;Database=PizzaDB;User Id=SA;Password=TheB@s3dPass"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=172.17.0.2,1433;Database=PizzaDB;User Id=SA;Password=TheB@s3dPass"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}

(docker ps)

dc9a3c76a8f8 mcr.microsoft.com/mssql/server:2019-latest "/opt/mssql/bin/perm…" 18 minutes ago Up 8 minutes 0.0.0.0:1433->1433/tcp, :::1433->1433/tcp sql1
s
(docker ip)
"IPAddress": "172.17.0.2",

        "PortBindings": {
            "1433/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "1433"
                }
            ]
        },
        "PortBindings": {
            "1433/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "1433"
                }
            ]
        },
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Entity framework
C#CC# / help
14mo ago
❔ Entity Framework
C#CC# / help
3y ago
❔ Entity Framework
C#CC# / help
4y ago
Entity Framework Entity Saving
C#CC# / help
11mo ago