When creating a开发者_开发技巧 T4 template in VB.NET, how do you specify Option Explicit
, Option Strict
, and Option Infer
settings? There's some sort of <#@ #> tag for doing this, but I can't find it.
If you're using Visual Studio 2010, the <#@ template #> directive has a new 'compilerOptions' parameter. This allows options to be passed directly to the codedom compiler. For example, for the VB compiler, /optionstrict+- /optioninfer+- /optionexplicit+-.
Hope this helps.
精彩评论