应用程序无法识别App_Code VS 2010中的类文件 [英] Application doesnt recognize class file in App_Code VS 2010

查看:100
本文介绍了应用程序无法识别App_Code VS 2010中的类文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将类文件放在App_Code文件夹的子文件夹中时出现以下错误:



errorCS0246:类型或命名空间名称''MyClassName''可以找不到(你是否缺少using指令或程序集引用?)



这个类根本不在命名空间中。有什么想法吗?

;)

解决方案

之所以发生这种情况,是因为,你已经移出了类文件它的位置..它是你的错误,因为你已经编译了你的应用程序,当它没有被移动..现在从App_Code构建你的ClassLibrary然后添加它的应用程序的引用..所有最佳:)

I am getting the following error when I put class files in subfolders of my App_Code folder:

errorCS0246: The type or namespace name ''MyClassName'' could not be found (are you missing a using directive or an assembly reference?)

This class is not in a namespace at all. Any ideas?
;)

解决方案

It happened because, you''ve moved out class file from its place.. It is givin you error because you''ve compiled your application when it wasn''t moved.. Now build your ClassLibrary from App_Code and then add its reference to your application.. All the Best :)


这篇关于应用程序无法识别App_Code VS 2010中的类文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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