user2023068
user2023068

Reputation: 445

How do I get the executable to run on other computers without creating a setup,

I have a program that graphs a text file with some data in it. It works in the debug/release modes of VS 2010 C#. I'm using the .Net and Aforge frameworks. In my references is AForge.Math and the System.Windows.Forms.Charting libraries.

When I run the executable in the ...bin/release folder it works completely, meaning that when I drag and drop my text file into my form a graph appears, as it should. However if I copy that release folder onto another computer the .exe runs but when I drag and drop the text file it doesn't plot. I just get a white blank form. This is what the program should look like when it's working... This is what the program should look like when it works

when it's not working it does something like this(so I've attempted to drag and drop a text file into the form) and I get something that looks like this.... This is not working

I suspect that my problem comes from using the AForge framework. All the computers have the .Net so when the data is input the charting continues to work but the data that is being graphed comes from AForge which is not on the computer. Although I am not entirely sure.

Upvotes: 2

Views: 3645

Answers (3)

Oscar Foley
Oscar Foley

Reputation: 7025

You should copy all the DLLs that you find in your debug or release folder. But sometimes not all the DLLs appear there. If you are using a framework maybe is looking for these DLLs in the installation directory or the GAC.

In this case that AForge is an external dlls so you have two solutions:

  1. Install AForge in all the pcs where you want to copy your program.
  2. CopyLocal True: In the references, in each AForge DLL, get sure that CopyLocal is true. Check this link for help on setting up CopyLocal=true. Then these DLLs will appear in your debug/release directory so when you drag all the references will work. Get sure that you copy all the files inside of debug/release folder, specially .dll, .exe, .config. Once you have it working maybe you can avoid copying .pdb files.

enter image description here

Personally I would try the last one.

Upvotes: 1

Prahlad Yeri
Prahlad Yeri

Reputation: 3653

Open your solution in Visual-Studio and expand the references from the solution-explorer. It should show you a reference list of all DLLs your project is referring to. It must also include your AForge framework if it is used.

Now all you have to do is to ensure that the same set of DLLs are present on the target system: Either in the exe's own path (This will be applicable for your custom DLLs such as AForge FW) or In the GAC (Global Assembly Cache) (Applicable for libraries that are installed such as your System.** framework libraries and MSOffice DLLs).

If something is missing, just copy the additional DLLs to your .exe folder on the target machine.

Upvotes: 0

BlackICE
BlackICE

Reputation: 8926

Try setting all your references to be copylocal = true, this should put a copy of the dll in the bin\release folder so you can copy them to the other computer. enter image description here

Upvotes: 0

Related Questions