VB.Net & C# WIndows application exe size

I

Ily

Hi

I have created a simple application in both vb.net and c#

Both apps display a hello in a messagebox in the form load event

When compiled:

the vb exe is 10KB
the C# exe is 20KB

Why the difference?
 
J

Jason Newell

Illy,

You can see the differences yourself.

ildasm VBApp.exe /out=VBApp.il
ildasm CSharpApp.exe /out=CSharpApp.il

This will disassemble your executables into intermediate language code.
Use any textual comparison tool to see the difference.

Jason Newell
 
H

Herfried K. Wagner [MVP]

Ily said:
I have created a simple application in both vb.net and c#

Both apps display a hello in a messagebox in the form load event

When compiled:

the vb exe is 10KB
the C# exe is 20KB

Why the difference?


Are you sure both are debug/release builds?
 
G

Guest

If you're using 2005, then the difference is likely due to the hidden files
VB uses to support part of the My namespace functionality (look in the
project directory to see what I mean). You'll see that there are more files
for the VB project: e.g., Application.Designer.vb and ApplicationEvents.vb.
This will be enough to cause the difference in exe size you're seeing.

With a non-trivial application, the difference will be nominal (i.e., about
10k).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
 
H

Herfried K. Wagner [MVP]

David Anton said:
If you're using 2005, then the difference is likely due to the hidden
files
VB uses to support part of the My namespace functionality (look in the
project directory to see what I mean). You'll see that there are more
files
for the VB project: e.g., Application.Designer.vb and
ApplicationEvents.vb.
This will be enough to cause the difference in exe size you're seeing.

Mhm... Accoding to the OP the C# executable is larger than the executable
created with VB:
 
G

Guest

D'oh!!
I was so sure of the answer, I didn't pay enough attention to the question!
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top