问题描述
我已经写了我的项目的APP_ code文件夹,名为ArchivedFilesWrapper类,但是当我在另一个文件中不同的文件夹中使用这个类,我得到错误:
类型或命名空间名称'ArchivedFilesWrapper'找不到(是否缺少using指令或程序集引用?)
我想每个页面应该能够找到包含在同一个项目中的类,但我想这是不是这样的。有人可以告诉我,我需要有什么using语句?
下面是从我班的一个片段:
使用系统;
使用System.Collections.Generic;
使用System.Linq的;
使用的System.Web;命名空间EMCWebAdmin.App_ code
{
公共类ArchivedFilesWrapper
{
如果您将其转换为一个web应用程序它应该工作。缺点是,它会在您每次改变它时不再自动构建您的code在APP_ code文件夹,并旋转起来的应用程序。我从来没有见过一个专业开发人员使用一个网站项目。我不知道,当他们创造他们谁MS进行定位。
I have written a class called ArchivedFilesWrapper in the App_code folder of my project, however when I use this class in another file in a different folder i get error:
The type or namespace name 'ArchivedFilesWrapper' could not be found (are you missing a using directive or an assembly reference?)
I thought every page should be able to find classes that are contained within the same project, but I guess this is not the case. Can someone please tell me what using statement I need to have?
Here is a snippet from my class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace EMCWebAdmin.App_Code
{
public class ArchivedFilesWrapper
{
If you convert it to a web app it should work. The downside is that it will no longer autobuild your code in app_code folder every time you change it and spin up the app. I have never seen a professional developer use a website project. I have no idea who MS were targeting when they created them.
这篇关于类型或命名空间不能从APP_ code文件夹中找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!