开发者

How can I create setup file for c# project?

开发者 https://www.devze.com 2023-03-26 07:29 出处:网络
How can I create a setup file including sql server 2008 that is needed for 开发者_开发百科database for a c# project ?To create a setup file for your project, you can use Setup Project, it will handle

How can I create a setup file including sql server 2008 that is needed for 开发者_开发百科database for a c# project ?


To create a setup file for your project, you can use Setup Project, it will handle many things for you, however if you want also to include the sql server, you can include its setup file, and then run it programmatically using Process.Start method, and pass the required args to it. Check out here, here and here is for examples on how it could be done.


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 need 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 with Advanced Installer on youtube.

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消