You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var sql = builder.AddSqlServer("sql", port: 14329)
.AddDatabase("sqldata")
.WithEndpoint(port: 14330);
WithEndpoint shows the following compile error:
The type 'Aspire. Hosting. ApplicationModel. SqlServerDatabaseResource' must be convertible to 'Aspire. Hosting. ApplicationModel. IResourceWithEndpoints' in order to use it as parameter 'T' in the generic method 'IResourceBuilder Aspire. Hosting. ResourceBuilderExtensions. WithEndpoint(this IResourceBuilder, int?, int?, string?, string?, string?, bool, bool?)'
I comment out the WithEndpoint, and run and get an exception:
/aspire-docs-samples/SupportTicketApi/SupportTicketApi.Api/bin/Debug/net8.0/SupportTicketApi.Api
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Undefined error: 0)
It appears to be a timing issue (presumably because the container is not fully up and running). If I run in debug and put a breakpoint on:
var context = scope.ServiceProvider.GetRequiredService<TicketContext>();
in Api.Program.cs, then continue, all works as intented.
Is there a way to delay until the container is fully provisioned?
The text was updated successfully, but these errors were encountered:
Hi, I'm running through the sample:
https://learn.microsoft.com/en-us/dotnet/aspire/database/sql-server-integrations
and have found a couple of issues.
Firstly, in the database declaration:
var sql = builder.AddSqlServer("sql", port: 14329)
.AddDatabase("sqldata")
.WithEndpoint(port: 14330);
WithEndpoint shows the following compile error:
The type 'Aspire. Hosting. ApplicationModel. SqlServerDatabaseResource' must be convertible to 'Aspire. Hosting. ApplicationModel. IResourceWithEndpoints' in order to use it as parameter 'T' in the generic method 'IResourceBuilder Aspire. Hosting. ResourceBuilderExtensions. WithEndpoint(this IResourceBuilder, int?, int?, string?, string?, string?, bool, bool?)'
I comment out the WithEndpoint, and run and get an exception:
/aspire-docs-samples/SupportTicketApi/SupportTicketApi.Api/bin/Debug/net8.0/SupportTicketApi.Api
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Undefined error: 0)
It appears to be a timing issue (presumably because the container is not fully up and running). If I run in debug and put a breakpoint on:
in Api.Program.cs, then continue, all works as intented.
Is there a way to delay until the container is fully provisioned?
The text was updated successfully, but these errors were encountered: