Posted By: alwaysmc2 | Apr 20th @ 12:30 PM
page 1 of 2
Comments: 32 | Views: 2990
alwaysmc2
alwaysmc2
It's not stupid; It's advanced.

I have this WinForms program that I'm writing, and recently I pulled a bunch of back-end code out and put it in a separate class library.  That seemed like the organized thing to do, and it allows me to more-easily port the program to Media Center when I get the time. Smiley

I was about to publish the application to my website, but I realized that the code that I put in the separate class library is no longer included in the exe file, but rather is put into a DLL.  That would be fine if the program was for installing, but the program is supposed to be ultra portable, and a single file makes that simpler.

Does anyone know how to force Visual Studio (I'm using C#) to put all of the necessary information into a single executable file?

Have you tried compiling a statically linked library as opposed to a dynamically linked one? I know that this is not hard to do in C. There should be a way to do it in C#.
littleguru
littleguru
allein, allein,... allein, allein!
Hmmm... why not zip it up and put it on the website. Might sound naive, but there are a lot of applications coming with DLLs and stuff and are available as zip files...
W3bbo
W3bbo
The Master of Baiters
Shining Arcanine wrote:
Have you tried compiling a statically linked library as opposed to a dynamically linked one? I know that this is not hard to do in C. There should be a way to do it in C#.


Because that's not how .NET works. FWIW, ILMerge is how you "statically link".
W3bbo
W3bbo
The Master of Baiters
alwaysmc2 wrote:

W3bbo wrote: Tried ILMerge?

More info at MSR.

Augh, a command line utility.  Don't these people who make otherwise great utilities know that no human wants to deal with the command prompt?
Thanks, though.  I'll look into it. Wink


Follow the MSR link, the author references a number of GUI frontends.
stevo_
stevo_
Casablanca != Manchester
There isn't a packaging method for apps yet? kinda like os x, it could just be a zip or something..

What are .application files? xbap? as they deploy in a pretty sleak fashion.
W3bbo
W3bbo
The Master of Baiters
alwaysmc2 wrote:
Denounce is a great example of a ClickOnce program, especially because it's so perty. Smiley 


Wow, looks nice. It shows what you can do with WPF when it's in the right hands (i.e. people with design sense).

thing is, when I try to open Denounce's *.application file I get an error.
CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
stevo_ wrote:
There isn't a packaging method for apps yet? kinda like os x, it could just be a zip or something..

What are .application files? xbap? as they deploy in a pretty sleak fashion.


They're sleek, but it's not single-file deployment.  .Application files just tell Windows to automatically download your files.

(Not that OSX has single file deployment either...  the Finder just makes *.app directories look like a single file, and there's nothing magic about a DMG that you couldn't do with a Zip file on Windows).
TommyCarlier
TommyCarlier
Trust me, I'm from the Internets
ILMerge is a great tool which we use at work. We automatically merge some of our assemblies in the PostBuild-events of the main assembly. It's really easy to set up.
TommyCarlier
TommyCarlier
Trust me, I'm from the Internets
Here's a line from the PostBuild-event of one of our projects, to merge its output with Weblications.Utils.dll (should all be on 1 line):
IF $(ConfigurationName)==Release
    "c:\Program Files\Microsoft\ILMerge\ilmerge.exe"
        /keyfile:c:\data\repository\weblications.snk
        /internalize /target:library
        /out:c:\data\repository\Binaries\$(TargetName).Merged.dll
        $(TargetPath)
        c:\data\repository\Binaries\Weblications.Utils.dll
wisemx
wisemx
Live it
alwaysmc2
Don't these people who make otherwise great utilities know that no human wants to deal with the command prompt?



Are you kidding?
The command prompt is coming back bigtime!
Lots of reasons to use it in VS2008, SQLMetal, ASP.NET, etc.
figuerres
figuerres
???
alwaysmc2 wrote:


I have this WinForms program that I'm writing, and recently I pulled a bunch of back-end code out and put it in a separate class library.  That seemed like the organized thing to do, and it allows me to more-easily port the program to Media Center when I get the time. Smiley

I was about to publish the application to my website, but I realized that the code that I put in the separate class library is no longer included in the exe file, but rather is put into a DLL.  That would be fine if the program was for installing, but the program is supposed to be ultra portable, and a single file makes that simpler.

Does anyone know how to force Visual Studio (I'm using C#) to put all of the necessary information into a single executable file?



Why?  depending on how you distribute the app you:

a) unzip a folder and click the .exe
b) installer does the copy and makes a shortcut
c) Click Once Install and that will also do updates for you.

Click Once will also update by comping only the new bits.
evildictaitor
evildictaitor
How could you use the adjective "indescribable" truthfully?
On the other hand, every two-bit piece of rubbish on the internet that you downloaded just so you could burn a CD, or convert a bizzare music format has it's own GUI nowadays, and its really irritating.
ZippyV
ZippyV
Soapbox = Fail
alwaysmc2 wrote:
I understand where it might be usefull, like in TommyCarlier's example, but a GUI application can accept arguments just like a console application can.


Unless you run Windows Server Core.