3

We're looking into using the TextFieldParser class using C#, and everything seems to work as expected.

However, the class is part of the Microsoft.VisualBasic assembly, and I wonder why? Surely there must be a reason why the class is in a language-specific (at least by name) assembly?

Any non-obvious side-effects from using it in a non-VB project?

Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
  • 1
    The Team felt it would help their *customers*? Get [CsvHelper](https://joshclose.github.io/CsvHelper/) instead, it works both ways (in and out). – Jimi Nov 25 '20 at 14:32
  • @Jimi Not sure what that means? Which team? The VB team? And they decided it wouldn't help C# customers? – Ted Nyberg Nov 25 '20 at 14:40
  • 4
    Different Teams :) The `Microsoft.VisualBasic` contains a whole lot more *helpers*. It's also meant to ease *transitions* to the language. What would C# devs migrate from? C++? C++ devs don't need *helpers* :) – Jimi Nov 25 '20 at 14:43
  • 3
    Microsoft when they developed the Net library had a goal of using one library for all there existing programming languages. So the Net is a single library for both Basic and c#. So methods from Basic and c# were combined. When Microsoft got finished people still wanted to used methods that were not part of Net consolidation. So the Microsoft.VisualBasic are these legacy methods that didn't make it into the Net Library. – jdweng Nov 25 '20 at 14:47
  • @jdweng Ah, I guess "VisualBasic" sounds better than "Legacy". :) I would consider your comment an answer, though. – Ted Nyberg Nov 25 '20 at 14:58
  • 5
    Dates from 2005 and .NET 2.0, lots of vb.net goodies got added back then. The My namespace is notable. TextFieldParser got a likely nod to help programmers get rid of a dependency on Microsoft.VisualBasic.Compatibility.VB6, it was intended to be temporary. Using it from another language is fine, it is well-designed. – Hans Passant Nov 25 '20 at 15:27
  • @HansPassant Would you mind posting your comment as an answer? Thanks! – Ted Nyberg Nov 26 '20 at 09:01

0 Answers0