INSTALL STEPS
- Clean machine: Win11 x64 23h2 ENU
- Install VS 17.9 P1
REPRO STEPS
- In the VS, create a new project > ASP.NET Core Web App (Model-View-Controller) > .NET 8.0 > none > check 'Enlist in Aspire Orchestration' > Create.
- Right-click the Models folder and add a new class file named Movie.cs, paste following codes:
public class Movie
{
public int ID { get; set; }
public string Title { get; set; } = string.Empty;
public DateTime ReleaseDate { get; set; }
public string Genre { get; set; } = string.Empty;
public decimal Price { get; set; }
}
-
Right-click the Controllers folder > Add > Controller > MVC Controller with views, using Entity Framework
- Model class: Movies.cs
- DbContext class: click '+' to create a new db context
- Database provider: select Azure Cosmos DB
-
Right-click web project > Add > Aspire component > Aspire.Microsoft.EntityFrameworkCore.Cosmos > install
-
Open appsettings.json file of web project, add following codes:
"Aspire": {
"Microsoft": {
"EntityFrameworkCore": {
"Cosmos": {
"DbContextPooling": true,
"Tracing": false
}
}
}
}
- Open Program.cs file of web project, add following code:
builder.AddCosmosDbContext<MyDbContext>("myConnection");
ACTUAL
Shows error under 'AddCosmosDbContext;':
There is no argument given that corresponds to the required parameter 'databaseName' of 'AspireAzureEFCoreCosmosDBExtensions.AddCosmosDbContext(IHostApplicationBuilder, string, string, Action?, Action?)'

Notes:
- According to the error message, change 'builder.AddCosmosDbContext("myConnection");' to 'builder.AddCosmosDbContext("myConnection"; "myConnection");', the error will disappear.

EXPECTED
No error shows