如何找到要在我的代码中需要的类的C#中导入的嵌套名称空间? [英] How do I find which nested namespace to import in C# for the classes I need in my code?

查看:78
本文介绍了如何找到要在我的代码中需要的类的C#中导入的嵌套名称空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我对C#感到愤怒的事情之一.我有大量的库正在尝试使用,由于某种原因,创建代码示例的人不够聪明,无法在示例中包含需要导入的名称空间.这是通常的情况.我发现自己在命名空间中搜索,有时有数百个嵌套试图找出我需要导入的名称.在java netbeans中,它甚至会告诉我要导入的软件包,因为它会搜索我.但是在C#中,我总是浪费无数的时间手动搜索名称空间.

This is one of the things I find infuriating about C#. I have thsi massive library im trying to use right now and for some reason the people who create the code examples are not smart enough to include the namespaces you need to import in the examples. This is usualyl the case. I find myself searching through the namespace, hundreds sometimes nested trying to figure out which ones i need to import. In java netbeans, it even tells me which packages to import because it searches for me. But in C# i always waste countless time searching through the namespace manually.

有什么办法可以解决这个问题.就像现在一样,我试图查找哪个名称空间包含Tweetinvi库的TwitterCredentials.

Is there any way I can get around this. Like right now im trying to find which namespace contains TwitterCredentials for Tweetinvi library.

严重的是,为什么人们没有在代码示例中包含名称空间.只是愚蠢的不这样做! 为什么Visual Studio不提供像Java这样的建议.真的,这只是常识....

Seriously, why do people not include the namespace in code examples. It's just stupid not to! And why does visual studio not make suggestions like java. It's just common sense really....

推荐答案

您可以对每个有错误或指向下方蓝色小条的单词按 Ctrl + .这个词,然后单击下拉列表,然后使用提供的名称空间.

You can press Ctrl + . on each word that has error or point to small blue bar under the word and click on dropdown, and use offered namespace.

这篇关于如何找到要在我的代码中需要的类的C#中导入的嵌套名称空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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