Exception when configuring MsSqlTestcontainer #439
-
When trying to set var config = new MsSqlTestcontainerConfiguration()
{
Port = 1433,
Password = "Pa$$w0rd!",
Username = "TestUser",
Database = "TestDb"
};
var container = new TestcontainersBuilder<MsSqlTestcontainer>()
.WithDatabase(config)
.WithExposedPort(1433)
.WithPortBinding(1433, 1433)
.Build(); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That's on purpose. As far as I know, you can not set the username and database through the MSSQL container start: You need to seed your database afterwards. |
Beta Was this translation helpful? Give feedback.
That's on purpose. As far as I know, you can not set the username and database through the MSSQL container start:
https://github.com/HofmeisterAn/dotnet-testcontainers/blob/859826e98e619000ffe5029f088ed9db86946d6f/src/DotNet.Testcontainers/Configurations/Modules/Databases/MsSqlTestcontainerConfiguration.cs#L44
You need to seed your database afterwards.