2016-11-15 57 views
-3

我有这种关问题App_Start命名空间参考 - App_Start命名空间

严重性代码说明项目文件的线路抑制状态 错误CS0234类型或命名空间名称App_Start'不存在命名空间“AqiCorp.FastSlot存在。 UI.MVC'(你是否缺少程序集引用?)AqiCorp.FastSlot.UI.MVC D:\ Code \ CSharp \ AqiCorp.FastSlot.V2 \ AqiCorp.FastSlot.UI.MVC \ App_Start \ Startup.Auth.cs 9活动

但我有我的项目里面的所有文件这个文件夹。

屏幕下方

enter image description here

有人能帮忙吗?

回答

0

App_Start文件夹中的文件可能存在于AqiCorp.FastSlot.UI.MVC命名空间中。在C#中,文件夹不一定代表名称空间。最重要的是在实际的类文件namespace

namespace AqiCorp.FastSlot.UI.MVC 
{ 
    public class BundleConfig 
    { 
     // ... 
    } 
} 

相反,你应该简单地指AqiCorp.FastSlot.UI.MVC命名空间,但是由于Startup类是在同一个命名空间,你可以简单地删除using语句AqiCorp.FastSlot.UI.MVC.App_Start

+0

我该怎么做才能设置这个参考? – user3887572

+0

@ user3887572我已更新答案。 –

+0

这是否意味着我应该替换“使用AqiCorp.FastSlot.UI.MVC.App_Start”上的“使用AqiCorp.FastSlot.UI.MVC” – user3887572