【发布时间】:2016-03-31 02:23:48
【问题描述】:
我在 Visual Studio 中收到此错误:
错误 CS7003 意外使用未绑定的通用名称 MyProject C:\Users[我的名字]\documents\visual studio 2015\Projects....\Index.cshtml 1
有问题的文件就在这里(第 1 行错误是对模型声明的引用):
@model MyProject.Models.MyAccount.Details
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_PrimaryLayout.cshtml";
}
<!-- Page Content -->
<div class="container">
.... more page stuff follows from here
模型类如下:
namespace MyProject.Models.MyAccount
{
public class Details
{
public static Details Select(Company c)
{
Details model = new Details();
model.SomeProperty = "SomeValue";
return model;
}
public String SomeProperty { get; set; }
}
}
奇怪的是,清理不会让它消失,重建会留下它,我构建/调试就好了。
【问题讨论】:
标签: c# asp.net-mvc-5