
default 'option explicit on' and 'option strict on'
Hi, Joris,
Quote:
> I have been searching for an option to have option explicit on and option
> strict on by default in every new project. Can you tell me how I can do
> this?
Unfortunately, in the Beta's and RC1, there is no UI option to turn on
Option Explicit and Strict on by default. However, you can manually edit the
default files that VS.NET uses for classes, modules and projects to turn
these things on.
You'll find these files in C:\Program Files\Microsoft Visual Studio
.NET\Vb7\VBWizards\ClassLibrary\Templates\1033 (or a similar location if
your install directory is different than the default or if your language
code isn't 1033). In this directory are directories for all the different
types of objects VS.NET can create.
For all files that end in .vb, you can add
Option Explicit On
Option Strict On
to the top of the file and they will appear when ever you create an item of
that type (e.g., a class). Files that end in .vbproj are XML files that
define a project. Add 'OptionExplicit = "On" OptionStrict = "On"' (case
sensitive, so be careful) to the VisualStudioProject | VisualBasic | Build |
Settings node as attributes to force these options on (as if you turned them
on in the Project Properties dialog in VS.NET).
Hope this helps,
Ian.