开发者

How to use VB `option` statements (explicit/infer/strict) in T4 templates?

开发者 https://www.devze.com 2023-01-08 06:32 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号