Tuesday, April 05, 2005
Compile of VB Imports vs. C# using
let's look at this Console App written in VB .
Imports
System.DataImports System.Windows.Forms
Class
class1Shared Sub Main()
Console.Writeline("Welcome")
End Sub
End Class
open the ConsoleApplication1.exe with ILDASM and have a look in manifest . UNFORTUNATELY vb compiler generated IL still references the system.data although it is not used in our app .
FORTUNATELY This is not the case in C#. try the same thing in C# , we find that C# compiler is smart enough to remove the unreferenced dlls from IL .
a point to C# against VB :-)