简体   繁体   中英

My program has included a DLL but only runs on my computer. My program runs on another computer but it doesn't see the hardware

(edit to separate paragraphs for readability)

I have this problem that really needs help. I have written a tool in C# and Visual Studio. This tool is to read I2C data back from a PCBA through an off-the-shelf programmer. After installing the driver for this off-the-shelf programmer, it talks to the computer via USB and talks to the PCBA (DUT) via I2C.

The tool I wrote has some basic UI to read in serial number and output the result. My problem is this tool works fine on my computer where I wrote the tool but when I run the released .exe file on another computer (client computer), it runs the first part of my program asking for serial number input and then stops while trying to talk to the programmer. If I install Visual Studio on this computer that I try to run my program with and open my source code to add the DLL through "Add Reference", it will work but this is not the right way to do it.

So, my question is why on the computer I try to run my tool, the DLL needs to be added again as a reference through Visual Studio. Isn't there a way just double click to run on every computer? I'm not really a programmer. I'm a hardware person so I have limited knowledge in Visual Studio / DLL / how to release the .exe. Please tell me how to correctly release this tool that has DLL in there. Thank you. (I'm using Visual Studio 2013.)

The beginning of my program has these using below. If I open Visual Studio on the target computer I try to run my tool, I saw using PP_COM_WRAPPER with red underline. It needs to be added as a reference again to make that red underline go away. I did install the off-the-shelf programmer driver first.

using System;
using System.IO;
using System.Windows.Forms; //for UI
using System.Collections.Generic;
using System.Text;
using System.Threading;
using PP_COM_Wrapper;

Thanks.

Actually need to credit this to Hans Passant, who gave the hint that it's software version issue in his comment. The off-the-shelf programmer is an older version on my computer where I wrote the tool. The client computer has newer version of the programmer. After I updated the Programmer to the same version as the client computer and re-create the setup file on my computer to run on the client computer, it works! Thanks everyone for the replies.

Do use setup project. Setup project include the dll (reference files) for you when you build the application project. When you go to install it on client machine it automatically installs the required dll files. So here i am trying to say to use Setup project and it may help you in solving your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM