how to publish c# window application installer

懵懂的女人 提交于 2019-12-20 07:47:06

问题


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

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 connection string SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection_string"].ConnectionString);

but it occurs error failed to update database because the database is read-only visual studio


回答1:


You need to check the prerequisites. The .net version on which you have created the application will be required along with other prerequisites. It's not visual studio that is required to run the executable, but just the .net framework.




回答2:


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) 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) 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) Finally, You have to install 3 programs as Prerequisites in client pc :

  • .Net Framework (I think started from version 4.5)
  • Sql Server Express
  • SSMS (Sql Server Management Studio)


来源:https://stackoverflow.com/questions/45584731/how-to-publish-c-sharp-window-application-installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!