Console App Basic Question

D

Dave

I created a console app in Visual Studio 2003 using C#.

How to I distribute this app after I build it?

It is my understanding that a C# app will run on any machine with the Net
Framework installed.

Do I simply copy the exe file to the machine on which the console app is to
run?

And if so, do I copy the exe from the bin or the obj folder? What is the
difference?

Finally, is there a good reference on building console apps? I checked MSDN
and did not find much.

Thanks
Dave
 
M

Morten Wennevik

Hi Dave,

I created a console app in Visual Studio 2003 using C#.

How to I distribute this app after I build it?

Just ship the executable. For larger projects you might consider creating
a setup project for your solution.

It is my understanding that a C# app will run on any machine with the Net
Framework installed.

It will provided they have the required version of framework installed.
If they have framework installed you will be told which one you need if
you don't have the correct version installed.
Do I simply copy the exe file to the machine on which the console app is
to
run?

Basically, yes. There might be dependencies you need to ship as well, but
if that is the case it is better to create a setup project.
And if so, do I copy the exe from the bin or the obj folder? What is the
difference?

bin/release or bin/debug. The debug version has debug information inside
and will be slightly larger.
Finally, is there a good reference on building console apps? I checked
MSDN
and did not find much.

Well, windows applications are very similar to console applications.
Instead of a console you typically use labels and textboxes for
output/input. You also need to attach a message loop to the windows
application (with Application.Run()).

I couldn't find anything specific for console applications, but many
tutorials for c# start with console applications. Any particular reason
for not building windows applications?
Thanks
Dave

No problem
 
S

SevDer

Dave said:
I created a console app in Visual Studio 2003 using C#.

How to I distribute this app after I build it?

It is my understanding that a C# app will run on any machine with the Net
Framework installed.

Do I simply copy the exe file to the machine on which the console app is to
run?

And if so, do I copy the exe from the bin or the obj folder? What is the
difference?

Finally, is there a good reference on building console apps? I checked MSDN
and did not find much.

Thanks
Dave
Hi Dave,

Yes, you simply copy your exe.
However try to build it with Release settings.

When you build release version, simply copy the .exe file from
bin/release folder.

Obj is used for other things by the ide.

About console apps., it is not different than other type of applications
in .NET. If you have more questions, feel free to send your questions to me.
 
P

Paul E Collins

Dave said:
I created a console app in Visual Studio 2003
using C#.
How to I distribute this app after I build it?

If your target machine already has the .NET Framework, you can simply
copy your .exe to that machine and run it. However, if you want to
build a proper installer (so that you can include other files with it,
add it to the Start menu, and/or provide uninstall capability), do the
following:

File > New > Project > Setup & Deployment Projects > Setup Project.

Add your application's .exe file to the setup project, and in most
cases all of its dependencies will be automatically detected. You can
then build the setup project to create an installer package.

P.
 

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