驻留在 App_Code 中的类不可访问 [英] Classes residing in App_Code is not accessible

查看:26
本文介绍了驻留在 App_Code 中的类不可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ASP.NET 中创建了一个网站,并创建了一个类并将其放在 App_Code 文件夹中.但是我无法从我的其他页面访问它.是否需要配置一些东西来允许这个?我已经让它在以前的项目中工作了,但不知何故在这个项目中没有.

I have created a website in ASP.NET and have created a class and put it inside of the App_Code folder. However I cannot access this from my other pages. Does something need to be configured to allow this? I have made it work in previous projects, but not in this one, somehow.

namespace CLIck10.App_Code
{
    public static class Glob
    {
        ...
    }
}

推荐答案

右键单击 App_Code 文件夹中的 .cs 文件并检查其属性.

Right click on the .cs file in the App_Code folder and check its properties.

确保构建操作"设置为编译".

Make sure the "Build Action" is set to "Compile".

这篇关于驻留在 App_Code 中的类不可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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