Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / July 2004

Tip: Looking for answers? Try searching our database.

Why the Microsoft.VisualBasic in Manifest

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael Liu - 24 Jul 2004 18:58 GMT
Hello,

I wrote two assemblies by VB.NET and C# to implement the same function to
sayHelloWorld.

After compilation, I used ILDASM to inspect the assembly DLLs.
Just found there are two more system assemblies(Microsoft.VisualBasic &
System) referenced by VB.NET than C#

Can anyone tell me why?
People always said on the .NET platform all the languages are same
including VB.NET & C#.  I just found another thing I cannot understand is:
vbHello.DLL is bigger than csHello.DLL

 1:52:55.58% type vbHello.vb
'
'vbHello.vb
'
Imports System
Namespace Hello
     Public Class World
           Public Function SayHelloWorld() As String
                 Return "Hello, World! From VB.NET Component!"
           End Function
     End Class
End Namespace

 1:53:03.05% type csHello.cs
//
//csHello.cs
//
using System;
namespace Hello
{
     public class World
     {
           public string SayHelloWorld()
           {
                 return "Hello, World! From C# Component!";
           }
     }
}

There are two more assemblies referenced.

.assembly extern Microsoft.VisualBasic
{
 .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )                         //
.?_....:
 .ver 7:0:5000:0
}
.assembly extern System
{
 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         //
.z\V.4..
 .ver 1:0:5000:0
}

Thanks,
Mike
Mattias Sj?gren - 24 Jul 2004 19:39 GMT
Michael,

>After compilation, I used ILDASM to inspect the assembly DLLs.
>Just found there are two more system assemblies(Microsoft.VisualBasic &
>System) referenced by VB.NET than C#
>
>Can anyone tell me why?

Microsoft.VisualBasic.dll is always referenced by VB programs.

System.dll shouldn't have to be there. But you probably referenced it
during compilation, and unlike the C# compiler, VB (prior to Whidbey)
doesn't remove unused references.

>People always said on the .NET platform all the languages are same
>including VB.NET & C#.

Don't believe them.

>I just found another thing I cannot understand is:
>vbHello.DLL is bigger than csHello.DLL

Is that a problem?

Unoptimized VB code tends to have more nop instructions than C#, for
debugability reasons. It can also have unused assemblyrefs as you
already have seen. If you want a fair comparison you should look at
optimized code and manually remove any references you don't need.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Anthony Moore - 28 Jul 2004 00:41 GMT
It would be more accurate to say that there are generally few differences
between the code generated by .NET languages rather than they are the same.
Those statements began at a time when languages like VB6, Java and C++ all
had completely different execution environments, so the .NET langauges are
all very simlar by those standards.

--------------------
| From: Mattias Sj?gren <mattias.dont.want.spam@mvps.org>
| Subject: Re: Why the Microsoft.VisualBasic in Manifest
[quoted text clipped - 42 lines]
|
| Mattias
?ric Moreau [VB MVP] - 25 Jul 2004 19:23 GMT
Whenever you start a new project in VB.Net, the Microsoft Visual Basic is
referenced.

To remove it, open your project properties and go to "Common
Prloperties->Imports". Remove Microsoft.VisualBasic.Compatibility.

Be warned that you may have many errors after removing it because a lot of
VB.Old programmers still use the old syntax.

Signature

HTH

?ric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc.(www.s2i.com)

> Hello,
>
[quoted text clipped - 56 lines]
> Thanks,
> Mike

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.