Cla*_*zye 5
所以我发现我不得不说builder.Congiguration
,而不仅仅是这样的配置:
builder.Services.AddDbContext<AppDbContext>(options =>
{
//the change ours here.
//builder.cofiguration and not just configuration
options.UseSqlServer(builder.Configuration.GetConnectionString("Default"));
});
您的代码中有“配置”变量,那么您为什么希望能够使用它?您尝试使用的 `Configuration` 是 `System.Configuration` 命名空间。如果您发布了实际的编译错误,这将很清楚。 (2认同)
更多推荐
字符串,出现错误,Studio,Visual,NET
发布评论