c#是一个命名空间,但是像一个类型一样使用? [英] c# is a namespace but is used like a type?

查看:277
本文介绍了c#是一个命名空间,但是像一个类型一样使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SMSApplication objsms = new SMSApplication();



错误是这样的



SMSApplication是一个命名空间,但用作类型

解决方案

请检查您的类和名称空间名称是否相同..



当名称空间和类名相同时,就会发生这种情况。

当你想使用命名空间时,写一个名称空间的全名。


你可以在smsApplication中编写应用程序名而不是类名。 br />
你的smsApplication可能有一些你需要实例化的类(如SMSLunch)。


错误是因为SMSApplication是命名空间而不是类。 br />
http://stackoverflow.com/questions/15007727 / namespace-but-is-used-like-a-type [ ^ ]



下次出现任何错误时,请转到此处此处此处

SMSApplication objsms=new SMSApplication();

Error is like that

"SMSApplication " is a namespace but is used like a type

解决方案

Please check that your class and name space name is same..

It happens when the name space and class name are same.
do one thing write the full name of name space when you want to use the namespace.


you might writing Application name instead of class name in smsApplication.
your smsApplication might have some class (like SMSLunch) that you need to instantiate.


The error is because "SMSApplication" is a namespace and not a class.
http://stackoverflow.com/questions/15007727/namespace-but-is-used-like-a-type[^]

Next time, when you get any error, go to here, here or here.


这篇关于c#是一个命名空间,但是像一个类型一样使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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