在 Visual Web Developer 2008 Express 中设置默认命名空间
大家好,我刚刚使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Visual Web Developer(2008 SP1 之前的版本)不支持 Web 应用程序项目。 默认命名空间仅在 Web 应用程序项目中可用。
如果您确实想将类添加到名称空间,则应该通过将它们包含在名称空间语句中来手动执行此操作(用代码片段包围的名称空间非常有用):
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:
如果您使用的是网站项目模板,则不会使用命名空间。 如果是这种情况,请考虑使用 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.
执行“查找和替换”来查找您的名称空间并将其替换为您想要的名称空间。
Do Find and Replace to find your namespace and replace it with what you want.