8

I have a console application built in visual studio 2010.

When I actually build the project I am getting .exe file under \bin\Debug\MyProj.exe.

When I Paste and run this .exe from other location it is expecting other files too.

Any thoughts how can I make this as Stand alone exe file.

8
  • 3
    Well presumably you have references to other libraries. Why don't you just copy those as well? You can use ilmerge, but it would be better to just copy the libraries IMO. Commented Nov 21, 2013 at 14:50
  • Visual Studio comes with a simple (but good for many needs) install project. You add the the output of your console project and it should detect any dependencies (including the .NET framework) that need to go with it. Commented Nov 21, 2013 at 14:53
  • This has already been answered here: stackoverflow.com/questions/2035083/… Commented Nov 21, 2013 at 14:53
  • @JonSkeet.Thank you for response. I have the dlls. I want to make it stand alone program. could you tell me how to do that. Commented Nov 21, 2013 at 14:54
  • May it is this, what you need: stackoverflow.com/questions/433171/… Cheers Commented Nov 21, 2013 at 14:54

3 Answers 3

1
  1. There should be other DLL's in the Debug library. You need those to run your exe.

  2. If there are no DLL's there, make sure you set the 'Copy local' property of the required references to True, and build again.

  3. If you want to make a standalone program, you should create a new Setup project in your solution. Include the Primary Output from your application project, and the setup should include the required DLL's automatically. Once you build the setup project, you can install your application as a standalone software.

Sign up to request clarification or add additional context in comments.

3 Comments

Copy Local won't help the OP here, as he's manually copy/pasting to another directory.
Thank you for response. I have the dlls. I want to make it stand alone program.
@Patan I've edited my answer, see #3. The cleanest solution to this is to create a setup.
1

You usually distribute application with bunch of DLLs, that's nothing bad.

But if you really want to make it a single exe, you can look here - same question is answered Embed .net dll in c# .exe . (Valid if your DLLs are also .Net assemblies)

Edit: If you need to easily distribute app to not-very-computer-friendly users, consider also trying ClickOnce. It's roughly something like Java Web start - only disadvantage is that you can't get "Windows Logo" certificate from Microsoft for projects distributed that way.

Comments

0

I don't have Visual Studio 2010 to experiment with, but in Visual Studio 2019 this worked:

Project Properties->Configuration Properties->Advanced->Use of MFC->Use MFC in a Static Library

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.