C#Application Executable将无法在任何其他设备上运行

时间:2015-03-25 15:27:56

标签: c# visual-studio

我已经开发了一个C#应用程序来搜索某个目录,读入包含某个字符串的任何文件,然后将它们与数据库进行比较,并对所述信息进行各种操作。我需要将项目\ exectuable上传到另一台机器上,它会在计时器上运行,但是每次我尝试在任何其他设备上打开exectuable时我都会收到Windows错误,GradeUpdate(我的项目名称)已停止工作。我在Visual Studio 2013中创建了这个项目,并且只有一些与众不同的引用,如下所示,我确保这些引用位于我的release文件夹中,我将其复制到我需要运行程序的设备上。

MySqlData.dll
MySqlWeb.dll

我从头开始重新创建项目,认为这可能是一个命名问题,但这并没有什么不同。此外,在Studio 2010中编写的C#应用​​程序可以在我尝试访问的计算机上运行,​​但是我编写的2013应用程序却没有。我相信可能有一些本地文件没有包含在我在本地计算机上访问的项目文件夹中,但这是我最好的猜测,任何和所有建议都会非常受欢迎!

2 个答案:

答案 0 :(得分:-1)

可能是因为该机器没有您要定位的.NET运行时版本吗?如果您使用的是Visual Studio 2013,则您的应用可能会以.NET 4.5为目标。您能确保目标计算机安装了.NET 4.5运行时吗?

答案 1 :(得分:-2)

the infamous works on the machine this is a common mistake that beginners make when learning to code.. just because it works on your machine will not guarantee that it will work on others I would first look at the properties of the .dll / assemblies and make sure that you have the CopyLocal property for the dll's set to true make sure that not only are you adding the assemblies in the using header section, but manually adding them to the reference node.. also make sure that the target machine has the same .net framework installed on their machine.