Visual Studio无法识别新类

时间:2021-08-03 22:53:52

I'm using visual studio 2008 SP1, I'm working with a web project in VB.NET. the problem when I add new class file (of-course in App_Code) it doesn't recognize it. all the old class files are working fine, but the new ones aren't. I restarted my computer and still the same problem.

我正在使用visual studio 2008 SP1,我正在使用VB.NET中的Web项目。当我添加新的类文件(当然在App_Code中)时,它无法识别它。所有旧的类文件都运行正常,但新的文件没有。我重新启动计算机仍然存在同样的问题。

Any Ideas

有任何想法吗

4 个解决方案

#1


34  

compare properties of working class with un recognised class. Specifically, "Build Action". It should resolve the problem.

将工作类的属性与未识别的类进行比较。具体来说,“构建行动”。它应该解决问题。

if not let me know. :)

如果没有让我知道。 :)

#2


1  

If there is a solution involved, try "rebuilding" the entire solution. Rebuilding projects and websites individually didn't do it for me - after trying other suggestions here only the project rebuild worked.

如果涉及到解决方案,请尝试“重建”整个解决方案。单独重建项目和网站没有为我做 - 在尝试其他建议后,只有项目重建工作。

#3


0  

Make sure it is in the same namespace as the thing you are trying to call it from, or fully declare using the namespace when creating one. Perhaps also give us an example of one that works and one that doesn't.

确保它与您尝试从中调用它的命名空间相同,或者在创建命名空间时使用命名空间完全声明。也许还会给我们一个有效的例子和没有的例子。

Also, don't forget to use the proper access modifier. Start with Public to see if that fixes your problem. If that does then your classes are almost certainly in different namespaces.

另外,不要忘记使用正确的访问修饰符。从公共开始查看是否可以解决您的问题。如果是这样,那么您的类几乎肯定在不同的名称空间中。

#4


0  

maybe you are trying to use internal classes from another assembly or there may be problems with the access modifiers of the class.

也许你正在尝试使用来自另一个程序集的内部类,或者类的访问修饰符可能存在问题。

#1


34  

compare properties of working class with un recognised class. Specifically, "Build Action". It should resolve the problem.

将工作类的属性与未识别的类进行比较。具体来说,“构建行动”。它应该解决问题。

if not let me know. :)

如果没有让我知道。 :)

#2


1  

If there is a solution involved, try "rebuilding" the entire solution. Rebuilding projects and websites individually didn't do it for me - after trying other suggestions here only the project rebuild worked.

如果涉及到解决方案,请尝试“重建”整个解决方案。单独重建项目和网站没有为我做 - 在尝试其他建议后,只有项目重建工作。

#3


0  

Make sure it is in the same namespace as the thing you are trying to call it from, or fully declare using the namespace when creating one. Perhaps also give us an example of one that works and one that doesn't.

确保它与您尝试从中调用它的命名空间相同,或者在创建命名空间时使用命名空间完全声明。也许还会给我们一个有效的例子和没有的例子。

Also, don't forget to use the proper access modifier. Start with Public to see if that fixes your problem. If that does then your classes are almost certainly in different namespaces.

另外,不要忘记使用正确的访问修饰符。从公共开始查看是否可以解决您的问题。如果是这样,那么您的类几乎肯定在不同的名称空间中。

#4


0  

maybe you are trying to use internal classes from another assembly or there may be problems with the access modifiers of the class.

也许你正在尝试使用来自另一个程序集的内部类,或者类的访问修饰符可能存在问题。