阻止 VS 自动添加 using 指令

Stop VS from automatically adding using directives(阻止 VS 自动添加 using 指令)
本文介绍了阻止 VS 自动添加 using 指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不介意创建脚本时自动创建的 using 指令.那些很好.我正在谈论的是在脚本顶部自动生成的 using 指令,而当我在引用超出范围的类型时立即进行编码.沉默的恶魔身上的痘痘!

I don't mind the using directives which are automatically created when the script is created. Those are fine. What I'm talking about are the using directives which are automatically generated at the top of the script while I'm coding as soon as I refer to a type which is out of scope. A pox upon the silent fiends!

为了澄清,目前如果我尝试在脚本中包含尚未声明为使用"的某个命名空间中存在的类型,则所述命名空间将自动添加到脚本的顶部.这对我来说是不受欢迎的行为.

To clarify, currently if I try including a type which exists in some namespace which is not yet declared as 'using' in the script, said namespace will get auto-added to the top of the script. This is undesired behavior for me.

我只是更喜欢手动添加我的命名空间.

I simply prefer to manually add my namespaces.

推荐答案

在工具下 >选项...>文本编辑器 >C# >IntelliSense,取消选中显示未导入命名空间中的项目(实验性)".

Under Tools > Options... > Text Editor > C# > IntelliSense, uncheck 'Show items from unimported namespaces (experimental)'.

这篇关于阻止 VS 自动添加 using 指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)