Questions tagged [option-infer]

10 questions
21
votes
5 answers

Best Practices: Option Infer

What do you feel are best practices for the use of Option Infer in your projects? In Visual Studio 2008, Option Infer is a directive that allows the compiler to infer the datatype of a declared variable by looking at what is assigned to it. This is…
Dan Coates
  • 2,002
  • 3
  • 17
  • 21
10
votes
2 answers

What is the best way to mix VB.NET's Option Strict and the new Option Infer directives?

In a related question, my team is about to (hopefully) start using LINQ, and I'd like to take advantage of anonymous types. What is the best way to mix VB.NET's Option Strict (which we've been using through the life of the project) and the new…
Bob King
  • 25,372
  • 6
  • 54
  • 66
6
votes
3 answers

Option Infer On or Off?

Possible Duplicate: Best Practices: Option Infer What is the best way to mix VB.NET's Option Strict and the new Option Infer directives? I am developing a old solution, that was translated from VB6 to the VB.NET. Actually, the default options in…
serhio
  • 28,010
  • 62
  • 221
  • 374
4
votes
2 answers

How do I turn on Option Strict / Infer in a VB.NET aspx page without a code behind file?

Umm, I guess my questions in the title: How do I turn on Option Strict / Infer in a VB.NET aspx page without a code behind file? <%@ Page Language="VB" %>