ASP.NET MVC 5教程错误:无法找到类型或名称空间名称
问题描述:
我正在通过一个关于YouTube的ASP.NET MVC 5教程。我真的很喜欢它。但是,我被困在似乎是一个奇怪的错误。奇怪的意思我认为我有教程中输入的所有内容,但VS2013正在标记我,我无法弄清楚什么可能是错的。将数学变量定义为课程似乎很好。但是,它不喜欢数学。ASP.NET MVC 5教程错误:无法找到类型或名称空间名称
型号/ Course.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MyfirstProject.Models
{
public class Course
{
int CourseID { get; set; }
string CourseName { get; set; }
int TotalCredits { get; set; }
}
}
控制器/ XyzController.cs
using MyfirstProject.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MyfirstProject.Controllers
{
public class XyzController : Controller
{
// GET: Xyz
public ActionResult Abc()
{
Course math = new Course();
.....
.....
似乎没有什么是你的代码错误只是尝试清洗液并重建公众。 –
注意:您已在课程POCO模型中将所有属性创建为私有。我认为这本来是要公开的。 –
我试过清洁和重建。然后关闭并重新打开。什么是私人?我不熟悉术语POCO。也许这就是为什么我不明白。 – abalter