[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C#.Net - Console application release

Posted on 2008-10-07
13
Medium Priority
?
1,688 Views
Last Modified: 2013-12-17
I have just completed building a C#.NET console application.  I've been running it the whole time out of Visual Studio 2008 and it has been working fine.  I was under the impression that when I was finished with it that I would be able to take this application and run it on any other computer that has the .NET Framework installed.  I tried to copy the .exe file from the bin/debug folder to the computer where it is supposed to run daily, but when I try to execute it just opens a command prompt window for a few moments and then closes it without doing anything or offering any warning.

I went back to my computer where I have been running the application from Visual Studio and tried to run the application from the bin/debug directory.  This gave me an error message.  How do I go about getting an executable file that I can run on any computer with the .NET Framework?

Also, I have added a reference class to the project in the form of a .dll file.  This is also present in the /bin/debug directory.  Once I have the program compiled, will it still rely on that file to work properly?
0
Comment
Question by:josephdaviskcrm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +1
13 Comments
 
LVL 13

Accepted Solution

by:
SameerJagdale earned 800 total points
ID: 22666599
instead of debug mode, try running the release mode exe.
BTW, can you share the error message.
0
 

Author Comment

by:josephdaviskcrm
ID: 22666639
Changing to release mode did create a new directory in the bin directory called release with all the same files in it.  When I tried to execute the .exe from the release directory I got the same error.

All the error message says is: "An error has occured and the program needs to close"  It is very non specific.

I tried the build=>Release option from the visual studio menu and was able to get the application installed on my computer and running.  But I need it to be installed on a remote server.
0
 
LVL 3

Expert Comment

by:trunghieubkit
ID: 22666642
Does your console program has any parameters?

is it OK when you run it by VS2008?

is it Error when you run from the Debug directory?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:jose_juan
ID: 22666654
Hi,

in most cases, if your code have not references to "non standard" libraries only the framework in client machine is needed.

Nevertheless, you must be sure than client machine have your .NET FrameWork installed.

If you need a independent (of .NET FrameWork) executable program, you can use C++ in non managed code (for not using .NET framework), this is the "traditional" coding mode.

If you be sure than client have .NET installed, then check all library dependencies, a simple way to solve it is create on your solution a "Installation proyect" (wizard), this is the correct way to install a program, but I think than you like a .exe alone.

On the other hand, you don't explain your code content and other problems are posible.

Good luck!
0
 

Author Comment

by:josephdaviskcrm
ID: 22666656
No it has no parameters.
Yes it runs fine inside VS2008.
Yes, it errors when I try to run it from the debug directory and from the release directory.  The only way I have been able to run it successfully are when...
I run it from Visual Studio.... and
After I publish it to my computer and it runs an install.  I then have a start menu shortcut that will execute the program outside of Visual Studio.  But I can't transfer those files anywhere else without generating the same error message.
0
 
LVL 5

Expert Comment

by:jose_juan
ID: 22666665
Ups!

I forgot.

I tried the next code and it run correctly in a non "Visual Studio" machine.

Regards.

using System;
 
namespace console_test {
	class Program {
		static void Main( string[] args ) {
			Console.WriteLine( "Hello World!" );
		}
	}
}

Open in new window

0
 
LVL 3

Assisted Solution

by:trunghieubkit
trunghieubkit earned 800 total points
ID: 22666670
When you copy to run on another computer you must copy both exe file and all relative dll files
0
 
LVL 13

Assisted Solution

by:SameerJagdale
SameerJagdale earned 800 total points
ID: 22666671
check for dependencies using dependencyviewer and if there are no dependencies then it shoud work.. further you can try logging the error to a file..
testexe.exe >mylogfile.log
0
 
LVL 5

Assisted Solution

by:jose_juan
jose_juan earned 400 total points
ID: 22666684
Hi josephdaviskcrm,

your code contains a component? (in a separated library)

If yes, VS register it (automatically) on runtime.

Regards.
0
 
LVL 3

Assisted Solution

by:trunghieubkit
trunghieubkit earned 800 total points
ID: 22666698
I may understand what's your problem
If yours is referred to a dll file, when you publish it, you have to ensure the dll file is included
0
 

Author Comment

by:josephdaviskcrm
ID: 22668444
Jose Juan, How do I register this component like you are talking about?
0
 

Author Closing Comment

by:josephdaviskcrm
ID: 31504122
Thanks to all that helped out on this one.  I finally got it working out on the server.  I've tried to divide out the points to everyone that contributed.
0
 
LVL 5

Expert Comment

by:jose_juan
ID: 22669898
Hi josephdaviskcrm,

using Regasm utility.

A good tutorial in

http://edndoc.esri.com/arcobjects/9.2/NET/9826f81b-278c-49cc-a912-ab8d86f5e91e.htm

Good luck!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question