【发布时间】:2014-09-02 10:38:38
【问题描述】:
我有这门课:
using System;
using System.Web.Mvc;
using System.Data;
using BLL;
namespace LicenseManager.Controllers
{
public class ValidationController : BaseController
{
public ActionResult Default()
{
return View("Default");
}
[HttpPost]
public JsonResult ClearInstallation(FormCollection form)
{
var jr = new JsonResult();
try
{
var licMgr = new BLL.LicManager();
licMgr.ClearInstall(form["regKey"], form["checkKey"]);
}
catch (Exception exc)
{
jr = Json(new { success = "false", error = exc.Message });
}
return jr;
}
}
}
当我尝试重建或调试时,我收到错误:The type of namespace name 'BLL' could not be found (are you missing a using directive or an assembly reference?)
我可以看到它被引用了:
智能感知有效,在我尝试重建或编译之前,我没有任何错误。我知道它存在,并且它发现它是为了智能感知,那为什么它不允许我重建或编译呢?
我试过了:
- 清洗溶液
- 重建
- 清除引用并重新添加它
我还能尝试什么?
更新 如果您收到此错误,请确保您阅读了输出。它包含了我的解决方案。
【问题讨论】:
-
当引用的项目使用不同的 .net 框架时,我遇到了类似的问题。你确认他们匹配了吗?您可以在属性/应用程序/目标框架中验证/更改框架
-
它们不同,它解决了我的问题。如果您将其发布为答案,我会接受。
标签: c# reference namespaces