简体   繁体   English

在计算机上运行ac#winform程序需要什么

[英]What is required to run a c# winform program on a computer

I have created a simple c# Winforms program that uses SQL Server and several DLLs. 我创建了一个简单的c#Winforms程序,该程序使用SQL Server和几个DLL。 What steps should I do in order to get the program run on another computer? 为了使程序在另一台计算机上运行,​​我应该怎么做?

Ie should I transfer the exe file + the dlls I used? 即我应该传输exe文件+我使用的dll?

Should I also install .net framework 3.5 on the other pc? 我是否还应该在另一台PC上安装.net framework 3.5?

I used visual studio 2008 to compile. 我使用Visual Studio 2008进行编译。

  1. install .net framework 3.5 安装.net Framework 3.5
  2. deploy your app. 部署您的应用。

You could also create an installer that automatically installs the .net framework for you. 您还可以创建一个安装程序,为您自动安装.net框架。 Don't forget to deploy the DLL as well. 不要忘记也要部署DLL。

You should create a installer using a Setup Project in visual studio instead of copying files. 您应该在Visual Studio中使用安装项目创建安装程序,而不是复制文件。 it will take care of most of the dependencies 它将处理大多数依赖项

You mention in you question that your application uses also MS SQL. 您在问题中提到您的应用程序也使用MS SQL。 In this case, apart from the .NET Framework, you should also be sure to provide an edition of MS-SQL for the client pcs as well. 在这种情况下,除了.NET Framework之外,还应该确保为客户端PC提供一个MS-SQL版本。 Unless the application is a distributed one, where you would connect to a SQL Server on another server, you will need a copy of SQL Server to be setup on the client pc. 除非该应用程序是分布式应用程序,否则您将在该位置连接到另一台服务器上的SQL Server,则需要在客户端PC上安装SQL Server的副本。 You should probably check out either an Express Version or greater edition of MS SQL Server to provide with your application 您可能应该签出Express版本或更高版本的MS SQL Server,以随应用程序一起提供

SQL Server Editions SQL Server版本

Other than that you should create an installer for your application, either by using the MS Visual Studio Setup Project functionality or any third party installer creation appllication. 除此之外,您还可以使用MS Visual Studio安装项目功能或任何第三方安装程序创建应用程序为应用程序创建安装程序。

Using Visual Studio Setup Project 使用Visual Studio安装项目

是的,另一台计算机还需要.net框架才能运行该应用程序。

obviously you have to install it (Unless its Windows 7 PC, because its already there) 显然,您必须安装它(除非它是Windows 7 PC,因为它已经在那里)

If you use any 3rd party dll's that should be present along with your App 如果您使用应与您的应用程序一起出现的任何第三方dll

You should install the .net framework. 您应该安装.net框架。 The version of .net framework required depends on what version you used when you created your project. 所需的.net框架版本取决于您创建项目时使用的版本。 You should also install MS SQL Express on the target machine. 您还应该在目标计算机上安装MS SQL Express。 After this you can copy the exe and any other dll-s you used or you could make a setup project that makes an installer for you. 之后,您可以复制该exe和您使用的任何其他dll,也可以创建一个安装项目来为您安装。

The application made in .Net are are translated to MSIL and tagreted to .net framework, hence you will need .net frame work on the running machine. .Net中的应用程序将转换为MSIL并标记为.net框架,因此您将需要在运行的计算机上使用.net框架。 You can have installer as others have mentioned and that will take care of it. 您可以像其他人提到的那样安装安装程序,这将解决问题。

Add a set up project to your solution so that the user can run it and install the application on his computer. 将设置的项目添加到您的解决方案中,以便用户可以运行它并在其计算机上安装该应用程序。 If .Net framework 3.5 is not installed on the target computer, the installer will let the user know that it needs to be present to be able to install and run the program. 如果目标计算机上未安装.Net Framework 3.5,则安装程序将让用户知道必须存在它才能安装和运行程序。 Look here and here for more on this. 在这里这里查看更多信息。 A set up project will also let you place the output from your application (dll:s and supporting files such as a database) in application folders on the users computer upon installation. 安装后,安装项目还将使您可以将应用程序的输出(dll:s和支持文件,例如数据库)放置在用户计算机上的应用程序文件夹中。

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

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