473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

VB.NET Compiled Executable footprint in .Net 2.0

In converting my projects from VS2003 to VS2005, I've found that my compiled
components file size has grown considerably (on average, by about 38%!!).

Althought drives are cheap, bandwidth and Time is not!

Investigating the assemblies with ILDASM (comparing my v1.1 to my v2.0),
I've noticed that there are many objects that have been emitted to the
assemblies under the "MY" namespace.

I've found in MSDN that I can set a compiler option of
"/define_MYTYPE=/"Empty/" to prevent my assemblies from being littered with
the MY. objects, but I can't figure out how / where to set this compiler
option.

If anyone can give me an example of how to set this compiler option, it
would be greatly appreciated - (I'd love to move to 2005, but the cost of the
file sizes may negate the advantages of the new platform).

Thanks in advance,

Skip V.
Nov 29 '05 #1
7 1805
"SkipV" <sk***@newsgroups.nospam> schrieb:
Investigating the assemblies with ILDASM (comparing my v1.1 to my v2.0),
I've noticed that there are many objects that have been emitted to the
assemblies under the "MY" namespace.

I've found in MSDN that I can set a compiler option of
"/define_MYTYPE=/"Empty/" to prevent my assemblies from being littered
with
the MY. objects, but I can't figure out how / where to set this compiler
option.


According to the documentation no 'define_mytype' compiler option exists
(<URL:http://msdn2.microsoft.com/en-us/library/w95cx9k1.aspx>). I was not
able to find any information about this option using Google and MSDN search
either. Thus I am really curious where in MSDN you found this option. I do
not think that there is such an option at all.

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

Nov 30 '05 #2
I too am interested in this. I found a reference to it's use in the example
for the nostdlib compiler option here:
http://msdn2.microsoft.com/en-us/library/79e7wdtc.aspx

You should be able to set the compiler options in the Compile Page of the
Project Designer (project properties). I cannot confirm this as I'm using
the useless VB Express version at the moment and it appears you can only get
VS05 if you have an MSDN sub.:-(

Regards

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eJ**************@TK2MSFTNGP15.phx.gbl...
"SkipV" <sk***@newsgroups.nospam> schrieb:
Investigating the assemblies with ILDASM (comparing my v1.1 to my v2.0),
I've noticed that there are many objects that have been emitted to the
assemblies under the "MY" namespace.

I've found in MSDN that I can set a compiler option of
"/define_MYTYPE=/"Empty/" to prevent my assemblies from being littered
with
the MY. objects, but I can't figure out how / where to set this compiler
option.


According to the documentation no 'define_mytype' compiler option exists
(<URL:http://msdn2.microsoft.com/en-us/library/w95cx9k1.aspx>). I was not
able to find any information about this option using Google and MSDN
search either. Thus I am really curious where in MSDN you found this
option. I do not think that there is such an option at all.

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

Nov 30 '05 #3
"Neal Andrews" <Neal@nospam> schrieb:
I too am interested in this. I found a reference to it's use in the example
for the nostdlib compiler option here:
http://msdn2.microsoft.com/en-us/library/79e7wdtc.aspx
That really seems to work when compiling from command line.
You should be able to set the compiler options in the Compile Page of the
Project Designer (project properties). I cannot confirm this as I'm using
the useless VB Express version at the moment and it appears you can only
get VS05 if you have an MSDN sub.:-(


Yes, at least in the August CTP there is an "Advanced Compile Options"
button there. Still do not have the final too, although I am an MSDN
subscriber.

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

Nov 30 '05 #4
dgk
On Wed, 30 Nov 2005 11:26:23 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Neal Andrews" <Neal@nospam> schrieb:
I too am interested in this. I found a reference to it's use in the example
for the nostdlib compiler option here:
http://msdn2.microsoft.com/en-us/library/79e7wdtc.aspx


That really seems to work when compiling from command line.
You should be able to set the compiler options in the Compile Page of the
Project Designer (project properties). I cannot confirm this as I'm using
the useless VB Express version at the moment and it appears you can only
get VS05 if you have an MSDN sub.:-(


Yes, at least in the August CTP there is an "Advanced Compile Options"
button there. Still do not have the final too, although I am an MSDN
subscriber.


I have the standard edition and I don't see anything in the compile
options except Enable Optimizations (defaults to checked). There are
options to have pre and post build event command lines which might be
useful.
Nov 30 '05 #5
Here's the online link to the compiler option:
http://msdn2.microsoft.com/library/m...US,VS.80).aspx

To navigate to it in your local MSDN (that installs with the IDE) go to :
MSDN2 Library > Development Tools and Languages > Visual Studio > Visual
Basic > Developing Applications with Visual Basic > Customizing Projects and
Extending My > Customizing Which Objects are Available in My
"Herfried K. Wagner [MVP]" wrote:
"SkipV" <sk***@newsgroups.nospam> schrieb:
Investigating the assemblies with ILDASM (comparing my v1.1 to my v2.0),
I've noticed that there are many objects that have been emitted to the
assemblies under the "MY" namespace.

I've found in MSDN that I can set a compiler option of
"/define_MYTYPE=/"Empty/" to prevent my assemblies from being littered
with
the MY. objects, but I can't figure out how / where to set this compiler
option.


According to the documentation no 'define_mytype' compiler option exists
(<URL:http://msdn2.microsoft.com/en-us/library/w95cx9k1.aspx>). I was not
able to find any information about this option using Google and MSDN search
either. Thus I am really curious where in MSDN you found this option. I do
not think that there is such an option at all.

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

Nov 30 '05 #6
I should probably qualify my original file size growth concerns with:
The compiled components of the system I'm working on range in file size
(v1.1) from 7k to 160k. Small footprints are important to us because we
update roughly 3000 sites (retail stores) thru dial-up connections (during
the night).

Anyway, I believe that I've found how to resolve my problem:
To get the IDE to spit out the vbc.exe compiler option of _MyType =
/"Empty/", I was able to edit the .vbproj file and change the value in the
<MyType></MyType> attribute from "Windows" or "WindowsWithCustomSubMain" to
"Empty".

After compiling with that change to my project file, the My namespace is
nowhere to be found in my compiled assemblies (and most importantly, my file
size is back down to where I expected it to be).

From what I understand, I should be able to setup a Project Template with
this modification to the .vbproj file and have any newly created projects
default to this Empty setting (although, I haven't tried this yet).

I've also found (figured I'd try one more thing before I posted this), that
if I set the Project Designer's -> Compile -> Advanced Compile Options ->
Custom Constants to a value of: _MyType="Empty". This will cause the IDE to
spit out the standard _MyType="Windows" (or whatever) along with my override
of _MyType="Empty". This override, appears to work (eventhough both _MyType=
options exist on the Output windows command line); the compiled assembly
again does not contain the My namespace and my file sizes are the reduced
size.
Take Care,

Skip V.

Nov 30 '05 #7
"SkipV" <sk***@newsgroups.nospam> schrieb:
Here's the online link to the compiler option:
http://msdn2.microsoft.com/library/m...US,VS.80).aspx


Thank you! That's really a useful article!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 30 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Filipe Martins | last post by:
Hello. I've read somewhere that the executable is smaller if we use a source file for each function! So, I tested this with gcc and it seams to confirm! What seams to happen is that if we call...
5
by: dave.harper | last post by:
I started learning C++ a few days ago, and I've run into a couple questions regarding what is included in the executable when the source is compiled... I've written a simple, 1-D rocket predicting...
3
by: codejunkie | last post by:
Hello, folks! Newbie question here: I just purchased Visual C++.NET 2003 Standard and have found the build sizes to be rather large. A simple "Hello World" executable (console) comes to 44Kb and...
8
by: Bob Dufour | last post by:
We got a windows form application that we wrote in VB.Net. Essentially its a manager for a list of persons and their contacts and some other info about the persons. No rocket science but lots of...
16
by: John | last post by:
Does the length of my C variable names have any affect, performance-wise, on my final executable program? I mean, once compiled, etc., is there any difference between these two: number = 3; n =...
30
by: Dave -Turner | last post by:
So I just downloaded Bloodshed devcpp, opened up the Hello example, compiled it, no problems ..... well, except one - the exe is 474,990 bytes! What's the secret to compiling small exes? Thanks
5
by: DBC User | last post by:
How would you develop a zero footprint application, is the smart client application a zero footprint application? Thanks.
40
by: castironpi | last post by:
I'm curious about some of the details of the internals of the Python interpreter: I understand C from a hardware perspective. x= y+ 1; Move value from place y into a register Add 1 to the...
12
by: nik | last post by:
Hi, I've compiled my application on my vista machine, and it won't run at all on my xp machine. In the windows error report I get Exception code; 0xe0434f4d. I searched for that exception, but...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.