命名空间或类不能找到(ASP.NET网站并QUOT;项目") [英] namespace or class could not be found (ASP.NET WebSite "project")

查看:142
本文介绍了命名空间或类不能找到(ASP.NET网站并QUOT;项目")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在试图清理了一下一个企业网站,我继承了这里。我设法清理你大多数的网站上的错误,但事情仍然在这里。

I am currently trying to cleanup a bit of a corporate website that I inherited here. I managed to clean up most of the errors in the website but something is still up here.

我有一个母版有此code:

I have one masterpage that have this code :

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage {
    public lists m_listsClass = new lists();

(不,这不是一个错字中列出了S)。

(no it's not a typo the S in lists).

现在在APP_ code我有一类lists.cs

Now in App_code I have one class lists.cs

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for lists
/// </summary>
public class lists
{
    public lists()
    {

当我尝试建立的网站在Visual Studio 2008中我有这样的错误:

When I try to build the website in visual studio 2008 I have this error :

Error   3	The type or namespace name 'lists' could not be found (are you missing a using directive or an assembly reference?)	C:\Users\egirard\Documents\Visual Studio 2008\Projects\iFuzioncorp\iFuzioncorp\Masters\MasterPage.master.cs	23	12	iFuzioncorp

我缺少的东西吗?

Am I missing something ?

我也看到了在服务器上的一些奇怪的行为。显然,根据IIS7它使用.NET 2.0编译(池配置了.NET 2),但也有一些使用的语句,包括LINQ的...怎么回事可以编译页面,如果LINQ的不是.NET 2本身的一部分?

Also I saw some strange behaviour on the server. Apparently according to IIS7 it is compiling using .net 2.0 (the pool is configured with .net 2) but there are some "using" statements that include Linq ... how is it possible to compile the page if Linq is not part of the .net 2 itself ?

只是在code本身的新闻细节进行编辑。没有命名空间都随处可见。

Just edited with news details on the code itself. No namespace at all everywhere.

推荐答案

我终于明白相当最近,这是一个的网站的,而不是一个的 Web应用程序的我不得不质疑这里的人得到它......所以这是很正常的所有​​错误我了。我还没有这个机会首先进行转换。

Finally I understood quite lately that it was a website and not a web application I had to question the guys here to get it... So it's quite normal all the error I had. I haven't had the occasion to convert it first.

这篇关于命名空间或类不能找到(ASP.NET网站并QUOT;项目&QUOT;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆