简体   繁体   English

C#WPF程序发布在其他计算机上不起作用

[英]C# WPF Program Relase not working on other computers

This may be a noobish question, but suppose I have a genereated exe from a program I ran in release mode on VS 2015, if I want to send my program to another computer, of course I send the Release folder (that has all of the appropriate DLLs + the main exe).. But does the user on the other computer have to have Visual Studios 2015 run my exe? 这可能是一个讨厌的问题,但是假设我有一个在VS 2015上以发布模式运行的程序中生成的exe,如果我想将程序发送到另一台计算机,我当然会发送Release文件夹(其中包含所有适当的DLL +主exe)。但是另一台计算机上的用户是否必须让Visual Studios 2015运行我的exe? If so, should I just make it so my program is actually installed on the other computer? 如果是这样,我是否应该这样做,以便我的程序实际上安装在另一台计算机上? It seems that when I send my exe to a computer that only has VS 2012 it doesn't want to run, but when I sent my exe to a computer with VS 2015 it will run.. Is this just coincidence perhaps? 看来,当我将exe发送到仅具有VS 2012的计算机时,它并不想运行,但是当我将exe发送到具有VS 2015的计算机时,它将会运行。也许这只是偶然吗?

If you've generated the .exe in VS 2015, it has probably compiled using .NET 4.5.1 or above. 如果您在VS 2015中生成了.exe,则可能是使用.NET 4.5.1或更高版本进行了编译。 This will not be the case for VS 2012. You need to either: compile your program against an earlier version of the .NET framework, which you can do in the project's properties. VS 2012并非如此。您需要:在早期版本的.NET Framework中编译程序,您可以在项目的属性中执行此操作。 Or, find out what version of the .NET framework you need, and make sure the client system has that .NET framework installed. 或者,找出所需的.NET框架版本,并确保客户端系统已安装该.NET框架。

No, you don't need to have VS instaled on client computer, neither 2012 nor 2015. All you need to ensure is that the computer have the same NET framework as your project has. 不,您不需要在客户端计算机上安装VS,无论是2012年还是2015年。您都需要确保该计算机具有与项目相同的NET框架。 For instance, if you project use Framework 4.0, you sen the release folder content and if that computer has the framework installed it should work. 例如,如果您计划使用Framework 4.0,则可以选择发布文件夹的内容,并且如果该计算机安装了框架,则它应该可以工作。 You must also check App.Config for your connection string if you are using a database. 如果使用数据库,则还必须检查App.Config中的连接字符串。

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

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