默认情况下如何启用 Visual Basic.NET 命名空间? [英] How do you enable Visual Basic.NET namespace by default?

查看:37
本文介绍了默认情况下如何启用 Visual Basic.NET 命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自 C# 背景和 Visual Studio.默认情况下会显示命名空间,但不会在 Visual Basic 中显示.是否可以选择在 Visual Studio 2008 中启用命名空间?

I'm coming from C# background and in Visual Studio. The namespace is shown by default but not in Visual Basic. Is there an option to enable namespace to be shown in Visual Studio 2008?

推荐答案

VB.Net 有一个项目默认命名空间的概念.在项目中创建的任何不包含显式命名空间的文件都将包含在默认命名空间中.

VB.Net has a concept of default namespace for a project. Any file created in the project which does not contain an explicit namespace will be intsead included in the default namespace.

如果您不喜欢这种行为,您可以从项目属性页面禁用它(右键单击项目并选择属性).转到应用程序选项卡并清除根命名空间文本框.这将强制您为定义的每个类型提供命名空间.

If you don't like this behavior you can disable it from the project property page (right click on the project and select properties). Go to the Application tab and clear the Root Namespace text box. This will force you to provide a namespace for every type you define.

这篇关于默认情况下如何启用 Visual Basic.NET 命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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