Need to create a smaller executable

I have an executable (written in C# using Visual Studio Express 2005) that is 688Mb.  I don't need all of the functions all of the time, so I wanted to take some of the .cs files and create .dlls out of them.

How do I do that? (a pointer to some docs would be nice). :D
rmmarshAsked:
Who is Participating?
 
ColemssConnect With a Mentor Commented:
http://www.c-sharpcorner.com/UploadFile/mahesh/dll12222005064058AM/dll.aspx

Then reference the created dlls in your main project.
0
 
rmmarshAuthor Commented:
OK... now, will these load ONLY if called?  Also, once in memory, and no longer needed, will they be paged out?
0
 
ColemssCommented:
There are many ways of managing dlls.  Read up on Garbage collection in .NET.

For the most part they are loaded on use.  Then if you destroy the object using them.  When garabage collections runs it cleans them out of memory.

I have to ask. What in your project makes it 600 MB. Do you store images?
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
rmmarshAuthor Commented:
No... just a very, very large book inventory program that does lots of things... great little program, just too big now... if you are interested, go to my website (www.pragersoftware.com)...

Thanks for the help...
0
 
ColemssCommented:
I only ask because it seems like your storing data in your application.  What you usually want to do is..  Create the data externally, like in dlls, and database files.  It must take for ever to load a 600mb exe.

I can't imagine 600mb of just code.  You must have some type of files stored.  I would look into externalizing as much as possible.  
0
 
ColemssCommented:
Also found a typo on your web site.  Thought you should know.

Ever wondered how competitive your rices are? How many sales are you losing by not having competitive prices? Prices change every day (almost every hour!), and its a real hassle to go though your inventory one book at a time, checking prices... not sure you have found the lowest or highest... We have the answer in our Repricing Tool.
0
 
rmmarshAuthor Commented:
Thanks Colemss... I'll fix the web site... and no, there is no data stored... I have about 10,000 lines of C# code, a form with lot's of tabs and am always pruning to make it smaller... but your ideas for .dll's are going to do the trick...

Thanks again for your suggestions and comments...

R
0
 
ColemssCommented:
Just though you would ilke to know I work on apps that have 100,000+ lines of code and are smaller than a 1 mb.   Im just guessing here but I think your duplicating imagelists or something.  

Happy coding!
0
 
rmmarshAuthor Commented:
Do you think it could be the windows form?  I have about a dozen tabs, each with lots and lots of text boxes, drop down lists, etc.  That's the only thing I can think of that would cause it.  All of my program options, etc are stored in XML files on the user's machine.  Absolutely no graphics are used anywhere!
0
 
ColemssCommented:
Dunno. I made a project added 20 tabs made 13 k exe.
Reduced it to 2 tabs and added 40 controls to both tabs made 44k exe.

You must be duplicating something. Probably cutting and pasting between tabs.  I would look at the designer code for controls you are not expecting to see.  Like a ImageList hidden behind another control.

Good luck
0
All Courses

From novice to tech pro — start learning today.