Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: AddSqlServerDbContext not found #3071

Closed
Hona opened this issue Mar 21, 2024 · 2 comments
Closed

bug: AddSqlServerDbContext not found #3071

Hona opened this issue Mar 21, 2024 · 2 comments
Labels
area-integrations Issues pertaining to Aspire Integrations packages needs-author-action An issue or pull request that requires more info or actions from the author.
Milestone

Comments

@Hona
Copy link

Hona commented Mar 21, 2024

I've got

var appDb = builder
    .AddSqlServer("db")
    .AddDatabase("appdb");

builder.AddProject<Projects.VerticalSliceArchitectureTemplate>("webapi")
    .WithReference(appDb);

builder.Build().Run();

with the following (on .NET 8)

        <PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.4.24156.9" />

And the component-consuming project is trying to register the EF Core piece

        services.AddSqlServerDbContext<AppDbContext>("appdb");

Which doesn't work.

image

I tried and there's no import I'm missing (that Rider could detect, at least)

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 21, 2024
@mitchdenny
Copy link
Member

Can you post a link to a repro repository so we can take a look?

@mitchdenny mitchdenny added this to the Backlog milestone Apr 9, 2024
@mitchdenny mitchdenny added area-integrations Issues pertaining to Aspire Integrations packages and removed area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Apr 9, 2024
@mitchdenny
Copy link
Member

Also just want to check, did you add the package reference to the right project?

@mitchdenny mitchdenny added the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 9, 2024
@dotnet dotnet locked and limited conversation to collaborators Apr 9, 2024
@davidfowl davidfowl converted this issue into discussion #3515 Apr 9, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
area-integrations Issues pertaining to Aspire Integrations packages needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

No branches or pull requests

2 participants