我使用ASP.NET MVC 3(Razor)和SQL Server 2008 Express制作简单的Azure应用程序。 而且有这样的错误: “错误CS0234:类型或命名空间名称‘WindowsAzure’不存在命名空间‘微软’存在(是否缺少程序集引用?)”Azure中模型中var项的问题
在此查看:
@foreach (var item in Model) { // error string
<tr>
<td>
@Html.DisplayFor(modelItem => item.TextThought)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id = item.IdThought }, new { id = item.IdThought }) |
法在控制器:
public ActionResult Index()
{
return View(db.GetThoughts());
}
方法内容:
public IQueryable<Thoughts> GetThoughts()
{
return _db.Thoughts;
}
请帮帮我,有人。
没有,所有referens是正确的,因为这段代码在没有Azure的ASP.NET MVC 3(Razor)中工作良好。 我认为这个错误是特定的Azure,但不明白... – user1271127 2012-03-15 09:33:51
根据您的错误消息,您尝试使用Visual Studio无法解析的命名空间'Microsoft.WindowsAzure',因此建议您检查您有正确的参考。 – 2012-03-15 09:43:40