选项严格 [英] option strict

查看:64
本文介绍了选项严格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何开启它?我在visual studio 2005 sp1中使用vb 2005.


在我的web.config中我有:


< compilation debug = "真"严格= QUOT;真" />


在我的工具/选项/项目和解决方案/ vb默认值中,我有选项

严格。


在我的.vb文件中,我有:


Dim NiceBug As Boolean =" Hello world"


很高兴编译。但是在运行时并不是那么开心。


我会感谢一些关于如何在我的

项目中启用选项严格而不必添加它的建议手动每个文件。


我上面描述的选项到底有什么影响呢?

How do I turn it on? I''m using vb 2005 in visual studio 2005 sp1.

In my web.config I have:

<compilation debug="true" strict="true" />

In my Tools/Options/Projects and solutions/vb defaults I have option
strict on.

In my .vb file I have:

Dim NiceBug As Boolean = "Hello world"

which happily compiles. Not so happy at runtime though.

I''d appreciate some advice as to how I get option strict enabled in my
projects without having to add it to every file manually.

And what exactly do the options I''ve described above actually affect?

推荐答案

使用C#


Poldie写道:
use C#

Poldie wrote:

如何打开它?我在visual studio 2005 sp1中使用vb 2005.


在我的web.config中我有:


< compilation debug = "真"严格= QUOT;真" />


在我的工具/选项/项目和解决方案/ vb默认值中,我有选项

严格。


在我的.vb文件中,我有:


Dim NiceBug As Boolean =" Hello world"


很高兴编译。但是在运行时并不是那么开心。


我会感谢一些关于如何在我的

项目中启用选项严格而不必添加它的建议手动每个文件。


我上面描述的选项到底影响究竟是什么?
How do I turn it on? I''m using vb 2005 in visual studio 2005 sp1.

In my web.config I have:

<compilation debug="true" strict="true" />

In my Tools/Options/Projects and solutions/vb defaults I have option
strict on.

In my .vb file I have:

Dim NiceBug As Boolean = "Hello world"

which happily compiles. Not so happy at runtime though.

I''d appreciate some advice as to how I get option strict enabled in my
projects without having to add it to every file manually.

And what exactly do the options I''ve described above actually affect?


re:

!我很感激有关如何在我的

!项目中启用选项严格的建议,而无需手动将其添加到每个文件中。 br />

更改VB.NET的Option Strict的默认值,请按照下列步骤操作:

找到WebApplication.vbproj,里面:

驱动器:\ VStudioInstallDir \ Common7 \IDE \ ProjectTempla tes \ VisualBasic \Web \ 1033 \ * WebApplicationProject.zi p


提取它,修改Option Strict行,使其打开,保存文件

并将其添加回zip文件,覆盖原始文件。


通知那里在同一个zip文件中的其他文件也必须设置选项。


此外,对于任何文件执行相同的操作:

drive: \ VStudioInstallDir \ Common7 \IDE \ ProjectTempla tes \ VisualBasic \Web

有选项严格=关闭


我同意IDE关于这个选项的设置是错误的,

但是有一个可行的解决方法,详见本文。


顺便说一句,如果你想改变其他类型项目的Option Strict选项

(Windows应用程序,Windows服务等),你需要为他们的*模板做同样的事情。

Juan T. Llibre,asp.net MVP

asp.net faq: http://asp.net.do/faq/

foros de asp.net,en espa?ol: http://asp.net.do/foros/

====== ================================


" Poldie" < Po **** @ gmail.comwrote in message

news:11 ********************** @ i13g2000prf.googlegr oups.com ...
re:
!I''d appreciate some advice as to how I get option strict enabled in my
!projects without having to add it to every file manually.

change the default value of Option Strict for VB.NET, follow these steps:

Locate WebApplication.vbproj, inside:
drive:\VStudioInstallDir\Common7\IDE\ProjectTempla tes\VisualBasic\Web\1033\*WebApplicationProject.zi p

Extract it, modify the Option Strict line so it''s On, save the file
and add it back to the zip file, overwriting the original file.

Notice there''s other files in the same zip file where the option must be set, too.

Also, do the same for any file in:
drive:\VStudioInstallDir\Common7\IDE\ProjectTempla tes\VisualBasic\Web
which has Option Strict = Off

I agree that the IDE is buggy regarding the setting of this option,
but there''s a viable workaround, as detailed in this post.

btw, if you want to change the Option Strict option for other types of projects
( Windows app, Windows Service, etc. ), you''ll need to do the same for *their* templates.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
======================================

"Poldie" <Po****@gmail.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...

如何打开它?我在visual studio 2005 sp1中使用vb 2005.


在我的web.config中我有:


< compilation debug = "真"严格= QUOT;真" />


在我的工具/选项/项目和解决方案/ vb默认值中,我有选项

严格。


在我的.vb文件中,我有:


Dim NiceBug As Boolean =" Hello world"


很高兴编译。但是在运行时并不是那么开心。


我会感谢一些关于如何在我的

项目中启用选项严格而不必添加它的建议手动对每个文件。


我上面描述的选项到底有什么影响?
How do I turn it on? I''m using vb 2005 in visual studio 2005 sp1.

In my web.config I have:

<compilation debug="true" strict="true" />

In my Tools/Options/Projects and solutions/vb defaults I have option
strict on.

In my .vb file I have:

Dim NiceBug As Boolean = "Hello world"

which happily compiles. Not so happy at runtime though.

I''d appreciate some advice as to how I get option strict enabled in my
projects without having to add it to every file manually.

And what exactly do the options I''ve described above actually affect?






6月23日上午12:44,Juan T. Llibre < nomailrepl ... @ nowhere.com>

写道:
On Jun 23, 12:44 am, "Juan T. Llibre" <nomailrepl...@nowhere.com>
wrote:

re:

!我'我很欣赏一些关于如何在我的

!项目中启用选项严格的建议,而不必手动将其添加到每个文件中。


更改默认值VB.NET的Option Strict值,请按以下步骤操作:

找到WebApplication.vbproj,里面:

drive:\ VStudioInstallDir \ Common7 \ IDE \ProjectTempla tes\VisualBasic \Web\1033 \ * WebApplicationProject.zi p


解压缩,修改Option Strict行,使其打开,保存文件

并将其添加回zip文件,覆盖原始文件。


请注意,同一个zip文件中有其他文件可供选择也必须设置。


此外,对以下任何文件执行相同的操作:

drive:\ VStudioInstallDir \ Common7 \IDE \ ProjectTempla tes\VisualBasic\Web

有选项Strict =关


我同意IDE在设置这个选项时有错误,

但是那里这是一个可行的解决方法,详见本文。


顺便说一下,如果你想为其他类型的项目更改Option Strict选项

(Windows应用程序,Windows服务等),你需要为*他们的*模板做同样的事情。
re:
!I''d appreciate some advice as to how I get option strict enabled in my
!projects without having to add it to every file manually.

change the default value of Option Strict for VB.NET, follow these steps:

Locate WebApplication.vbproj, inside:
drive:\VStudioInstallDir\Common7\IDE\ProjectTempla tes\VisualBasic\Web\1033\*WebApplicationProject.zi p

Extract it, modify the Option Strict line so it''s On, save the file
and add it back to the zip file, overwriting the original file.

Notice there''s other files in the same zip file where the option must be set, too.

Also, do the same for any file in:
drive:\VStudioInstallDir\Common7\IDE\ProjectTempla tes\VisualBasic\Web
which has Option Strict = Off

I agree that the IDE is buggy regarding the setting of this option,
but there''s a viable workaround, as detailed in this post.

btw, if you want to change the Option Strict option for other types of projects
( Windows app, Windows Service, etc. ), you''ll need to do the same for *their* templates.



我会给你一个机会,虽然听起来好像我可以在下次创建一个新项目时生成
而不是改变我现有的



正如我上面所解释的,我已经在web.config中更改了我的条目并且
$菜单中有b $ b,所以如果您的解决方案有效,它在哪里更改

设置,我是否可以手动设置?


干杯,

Poldie。

I''ll give that a go, although it sounds like something which might
come into effect when I next create a new project rather than change
my existing one.

As I explained above, I''ve already changed my entry in web.config and
in the menu, so if your solution works, where is it changing the
setting, and can I not set it myself manually?

Cheers,
Poldie.


这篇关于选项严格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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