重启Visual Studio工具,确保包的所有引用都被加载。
确保应用程序DbContext存在,并且已添加到Startup.cs中。示例:
namespace MyApplication
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// 添加DbContext
services.AddDbContext
// ...
}
// ...
} }
上一篇:ASP.NET简介
下一篇:ASP.NET加载页面时出现沙漏