我可以设置选项显式和严格选项上一个项目/解决方案的水平? [英] Can I set Option Explicit and Option Strict on a Project/Solution level?
问题描述
我真的很喜欢的编码速度vb.net提供了,但我不喜欢的可能性忘记声明变量类型,函数返回类型,等等,这就是为什么在我使用的每一个类:
I really like the coding speed that vb.net provides, but I don't like the possibility to forget to declare variable types, return types of functions, etc. and that is why in each class I use:
Option Explicit On
Option Strict On
有没有一种方法来定义该项目/解决方案的水平这两个选项?
这实在是乏味的复制这两个选项中的每一类...
我们code与VS2010在.NET 4的客户端配置文件。
Is there a way to define those two options on the project/solution level?
It is really tedious to copy those two options in each class...
We code with VS2010 in .net 4 client profile.
推荐答案
是,您可以在项目的属性整个项目设置这些选项:
Yes, you can set these options for the entire project in your project's Properties:
- 在解决方案资源管理器右键单击项目,然后从上下文菜单中选择属性。
- 单击中的左侧列表中的编译标签。
- 根据需要设置组合框的值。
   
您也可以选择指定这些设置的全球在Visual Studio的选项(虽然这只会影响的新的项目,而不是现有的):
You could also choose to specify these settings globally in the Visual Studio options (although this will only affect new projects, not existing ones):
- 在Visual Studio环境中,单击工具菜单,选择选项。
- 展开在对话框的左侧树形视图的项目和解决方案的项目。
- 选择VB默认值项。
- 根据需要设置你的默认项目设置。
   
这篇关于我可以设置选项显式和严格选项上一个项目/解决方案的水平?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!