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?

Re: VB.Net & C# WIndows application exe size by Jason

Jason
Tue Nov 15 10:12:21 CST 2005

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

Ily wrote:
> 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?
>

Re: VB.Net & C# WIndows application exe size by Herfried

Herfried
Tue Nov 15 10:40:09 CST 2005

"Ily" <ilyas@igsoftwaresolutions.co.uk> schrieb:
> 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?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

RE: VB.Net & C# WIndows application exe size by DavidAnton

DavidAnton
Tue Nov 15 19:25:04 CST 2005

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



"Ily" wrote:

> 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?
>
>

Re: VB.Net & C# WIndows application exe size by Herfried

Herfried
Wed Nov 16 07:15:19 CST 2005

"David Anton" <DavidAnton@discussions.microsoft.com> schrieb:
> 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:

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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: VB.Net & C# WIndows application exe size by DavidAnton

DavidAnton
Wed Nov 16 10:00:19 CST 2005

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



"Herfried K. Wagner [MVP]" wrote:

> "David Anton" <DavidAnton@discussions.microsoft.com> schrieb:
> > 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:
>
> >> the vb exe is 10KB
> >> the C# exe is 20KB
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>
>