在 Visual Web Developer 2008 Express 中设置默认命名空间

发布于 2024-07-10 01:58:27 字数 218 浏览 5 评论 0原文

大家好,我刚刚使用 Visual Web Developer 2008 Express 启动了一个新项目,并且我的所有隐藏代码都不在任何命名空间中。 如何设置项目的默认命名空间?

在 VisualStudioPro 中,它曾经位于项目属性中,而 Visual Web Developer 2008 Express 中的网站属性似乎非常...表达。

谢谢,

大卫。

Hi all I've just started a new project using Visual Web Developer 2008 Express and all my code behinds are not in any namespace. How can I set the default namespace for the project?

In VisualStudioPro it used to be in project properties, the website properties in Visual Web Developer 2008 Express seem very ... express.

Thanks,

David.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空城之時有危險 2024-07-17 01:58:27

Visual Web Developer(2008 SP1 之前的版本)不支持 Web 应用程序项目。 默认命名空间仅在 Web 应用程序项目中可用。

如果您确实想将类添加到名称空间,则应该通过将它们包含在名称空间语句中来手动执行此操作(用代码片段包围的名称空间非常有用):

namespace MyDefaultNamespace {
   // original code
}

Visual Web Developer (prior to 2008 SP1) does not support Web Application projects. Default namespace is only available in Web Application projects.

If you really want to add your classes to a namespace, you should do it manually (the namespace surround with code snippet can prove pretty useful) by enclosing them in a namespace statement:

namespace MyDefaultNamespace {
   // original code
}
林空鹿饮溪 2024-07-17 01:58:27

如果您使用的是网站项目模板,则不会使用命名空间。 如果是这种情况,请考虑使用 Web 应用程序项目模板。

If you are using the Website Project Template, then namespaces aren't used. If this is the case, consider using the Web Application Project Template.

深海夜未眠 2024-07-17 01:58:27

执行“查找和替换”来查找您的名称空间并将其替换为您想要的名称空间。

Do Find and Replace to find your namespace and replace it with what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文