Change the Default Project Values in .NET
You can change the default values of Option Explicit and Option Strict on a per project type basis. For example, when you create a new Visual Basic .NET or Visual Basic 2005 application, the value for Option Explicit is set to On. You can change this default value to Off.
To change the default values of Option Explicit and Option Strict, follow these steps:
- Locate the following project template files on your system:
- EmptyProjectIPF.vbproj
- EmptyWebProjectIPF.vbproj
- WebApplication.vbproj
- WebControl.vbproj
- WebService.vbproj
- WindowsApplication.vbproj
- WindowsControl.vbproj
- WindowsService.vbproj
- Open a project template in Notepad.
- Add (or edit if they are already present) the OptionStrict and OptionExplicit lines in the
section of the template.
For example, the following code demonstrates how to set OptionExplicit to Off and OptionStrict to On:
OutputType = "Exe"
StartupObject = ""
OptionExplicit = "Off"
OptionStrict = "On"
>
- Repeat steps 2 and 3 for each project template that you want to change the default behavior for.
No comments:
Post a Comment