使用带有MSI的C#(以及VS2005)应用程序部署MDF文件 [英] Deploying MDF File with C# (well VS2005) application with MSI

查看:67
本文介绍了使用带有MSI的C#(以及VS2005)应用程序部署MDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

       我正在尝试尝试(谷歌围绕部署MDF文件的同一主题),遇到了这个常见错误

         I'm trying in vein (google around the same subject of deploying MDF File), faced this common error

 

由于复制数据库文件失败,无法在SQL Server中生成用户实例"

"failed to generate a user instance in SQL server due to failure in copying database file"

这是我所做的:

1)使用计算机A编写C#应用程序,并在计算机A上进行测试,运行发行版"没有问题.或调试版本.

1)Write C# Application using Computer A, tested at Computer A, No Problem either running the "Release" or Debug version.

注意:mdf文件位于我开发的同一应用程序内.

Note: the mdf file resided inside the same application that I developed.

2)生成MSI应用程序以将该应用程序部署到计算机B.

2) Generate MSI application to deploy the application to Computer B.

然后弹出上述问题.

 

我通过各种站点和论坛(包括此站点)进行了阅读,并尝试了所有建议示例,用户实例= false.或删除本地设置"中的文件夹,无济于事.

I read thru various site and forum (including this) and tried with all the suggestion example, user instance= false. or deleting folder in "local Setting", nothing help.

 

想知道为什么吗?请帮助

Wonder why ? Please help

 

谢谢

 

 

 

 

推荐答案

您好,您的连接字符串是什么?看来您的应用程序工作目录有问题.尝试仅使用MDF的文件名设置连接字符串源,并使用工作目录创建应用程序的快捷方式 设置正确.

Hello, what is your connection string? It seems that you have a problem with your application working directory. Try to set the connection string source only with the filename of your MDF and create a shortcut to the application with the working directory set properly.

再见

米格尔.


这篇关于使用带有MSI的C#(以及VS2005)应用程序部署MDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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