我对错误感到困惑 There was an error getting the type

I am confused about the error There was an error getting the type

当我尝试使用创建模板并使用模型 class 和数据上下文 class 创建视图时,出现错误:

There was an error getting the type 'project.Models.Tablename'. Try Rebuilding the project.

如何解决?

我已经尝试删除模型并使用 ado.net

再次构建它

如错误所述 Try Rebuilding the project。转到构建菜单并重建,这应该会清除您的错误。