I have an XML Schema Definition (XSD) file in Visual Studio 2010. The DataSet constructor generates a strongly typed dataset in the <name> .designer.vb file
Depending on the number of error factors, it seems to sporadically provide strong typing for enumerated operations (used in LINQ or for each loop)
For example, sometimes the generated code base can detect a type, and sometimes not:

The offensive code seems to be whether the generated file has a function:
Public Overridable Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator Return Me.Rows.GetEnumerator End Function
If so, then calling the enumerator for the function will return a boring object .
If this is not the case, the enumerator will return the appropriate type.
My question is:
How can I get it to consistently generate appropriate behavior?
Our source code does not contain the generated code, so each developer should generate it for himself. This causes some machines to get compiler errors with incorrect typing, while others not ... with the same source code.
Some things that seem to have something to do with it:
- Client-oriented assembly version of .NET 4.0 VS.NET 4.0
- Regardless of whether the XSD, designer, or use files are open during generation
- Others?
Possible workarounds:
- Enable strong typing / casting with all ads
- Include correctly generated file in source control
source share