简体   繁体   English

我的程序包含一个DLL,但仅在我的计算机上运行。 我的程序在另一台计算机上运行,​​但是看不到硬件

[英]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. 我已经在C#和Visual Studio中编写了一个工具。 This tool is to read I2C data back from a PCBA through an off-the-shelf programmer. 该工具用于通过现成的编程器从PCBA读取I2C数据。 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. 在为该现成的编程器安装驱动程序之后,它通过USB与计算机通信,并通过I2C与PCBA(DUT)通信。

The tool I wrote has some basic UI to read in serial number and output the result. 我编写的工具具有一些基本的UI,可以读取序列号并输出结果。 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. 我的问题是此工具在我编写该工具的计算机上运行良好,但是当我在另一台计算机(客户端计算机)上运行已发布的.exe文件时,它将运行程序的第一部分,要求输入序列号,然后在尝试时停止与程序员交谈。 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. 如果我在尝试运行程序的计算机上安装Visual Studio,并打开我的源代码以通过“添加引用”添加DLL,它将起作用,但这不是正确的方法。

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. 因此,我的问题是为什么在我尝试运行工具的计算机上,需要再次添加DLL作为通过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. 我是硬件专家,所以我对Visual Studio / DLL /如何发行.exe知识有限。 Please tell me how to correctly release this tool that has DLL in there. 请告诉我如何正确释放具有DLL的此工具。 Thank you. 谢谢。 (I'm using Visual Studio 2013.) (我正在使用Visual Studio2013。)

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. 如果我在目标计算机上打开Visual Studio,尝试运行我的工具,则会看到使用带红色下划线的PP_COM_WRAPPER。 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. 实际上,这要归功于Hans Passant,他在评论中暗示了这是软件版本问题。 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! 在将Programmer更新为与客户端计算机相同的版本并在我的计算机上重新创建安装文件以在客户端计算机上运行之后,它可以工作! Thanks everyone for the replies. 感谢所有人的回复。

Do use setup project. 请使用安装项目。 Setup project include the dll (reference files) for you when you build the application project. 生成应用程序项目时,安装程​​序项目将为您提供dll(参考文件)。 When you go to install it on client machine it automatically installs the required dll files. 当您在客户端计算机上安装它时,它会自动安装所需的dll文件。 So here i am trying to say to use Setup project and it may help you in solving your problem. 所以在这里我想说要使用安装项目,它可能会帮助您解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .exe 文件在我的计算机上运行良好,但在其他计算机上运行不正常 - .exe file runs perfectly fine on my computer, but doesn't run perfectly on others 无法从我的程序写入另一台计算机上的XML文件 - Cannot write to XML file in another computer from my program 一个程序在我的计算机上工作正常,但是当我使用荷兰语Windows在另一个程序上发送该程序时,DateTimePicker出现了问题 - A program worked fine on my computer but when I sent it on another one with a Dutch Windows it has problems with the DateTimePicker 在我的计算机上输出程序功能,但在其他用户的计算机上没有 - Outputted program functions on my computer but not other user's computer 为什么我的WCF wshttpbinding客户端不能在另一台计算机上工作? - Why is my WCF wshttpbinding client doesn't work at another computer? 引用dll文件-我的AutoCAD插件仅在我的计算机上有效 - Referencing dll files - my AutoCAD plugin only works on my computer 从Visual Studio打开的CMD提示符不会在我的计算机上启动exe。 为什么不? - CMD prompt opened from Visual Studio won't launch a exe on my computer. Why not? 我的程序在运行一段时间后遇到了 Stack-overflow 问题。 它在一段时间内工作正常,直到它不工作 - My program runs into a Stack-overflow issue after some time of running. It works fine for sometime until it doesn't 使用 LinqToExcel 的程序可以在我的电脑上运行,但在另一台电脑上发布和安装后就不行了 - Program using LinqToExcel works on my computer but after publishing and installation on another one it does not 更改线程优先级以使我的程序和计算机更具响应性 - Changing thread priority to make my program and computer more responsive
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM