如何发布C#窗口应用程序安装程序 [英] how to publish c# window application installer

查看:404
本文介绍了如何发布C#窗口应用程序安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试发布C#Windows应用程序.我尝试安装Shield和Visual Studio安装程序,但无法正常工作.

I'm trying to publish C# Windows application. I tried to install shield and visual studio installer but it does not work properly.

此设置只能安装在装有Visual Studio的那些笔记本电脑或PC上.谁能帮助我,需要具备哪些先决条件以及如何发布安装程序setup.exe

This setup can install only on those laptops or PC in which visual studio is installed. can anyone help me what are prerequisites are required and how can publish installer setup.exe

app.config 连接字符串 SqlConnection con =新的SqlConnection(ConfigurationManager.ConnectionStrings ["connection_string"].ConnectionString);

app.config connection string SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection_string"].ConnectionString);

但发生错误 由于数据库是只读Visual Studio而未能更新数据库

推荐答案

我也遇到了有关如何使安装文件在任何其他设备上运行的相同问题,尽管我花了一些时间来了解该过程,但最终我已经发现这真的很简单.

I have faced the same problem about how to get the setup file to work in any other device although it takes some time for me to understand the process but finally i have found that it's really simple.

1)您必须将连接字符串更改为类似的内容:

1) you have to change the connection string to something like that :

string connectionStr = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|DatabaseName.mdf;Integrated Security=True";

2)您可以使用 Advanced Installer 生成安装文件,过程很简单,您可以观看有关如何在Advanced Installer中获取安装文件的任何简短教程.

2) you can use Advanced Installer to generate the setup file, the process is simple, you can watch any short tutorial about how to get the setup file in Advanced Installer.

3)最后,您必须在客户端pc中安装3个程序,作为先决条件:

3) Finally, You have to install 3 programs as Prerequisites in client pc :

  • .Net Framework(我认为从版本4.5开始)
  • Sql Server Express
  • SSMS(Sql Server Management Studio)

这篇关于如何发布C#窗口应用程序安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆