请教打包部署问题
刚做好的一个系统,在公司内部运行良好,都差不多装了。NET,拿到客户那儿发现始终有个窗体无法打开,提示错误:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at 生产管理.addnewjitai.addnewjitai_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
我用的网上公认的打包方法,
如下:
4.一般会自动将依赖项添加到“检测到的依赖项”,如果没有,那么我们要手动将其加入步骤5)
Crystal_Managed2003.msm (如果有水晶报表)
dotnetfxredist_x86.msm (.net一定是必须的)
... (如果有引用其他的dll)
5.如果使用了水晶报表,手动加入要包含的文件:项目-->添加-->合并模块(添加你的程序文件) (包括dotNetFramework和MDAC27),位于:C:\Program Files\Common Files\Merge Modules\ 下,*为必要的
具体功能如下:
(托管组件 MSM 处理所有托管组件的分发,其中包括 Windows 窗体查看器、Web 窗体查看器和所有 Crystal Decisions 命名空间)
* Crystal_Managed2003.msm
Crystal_Managed2003_chs.msm
(对于使报表运行所需的所有其他文件,由数据库访问 MSM 处理其分发。其中包括数据库、导出和图表驱动程序。)
* Crystal_Database_access2003.msm
Crystal_Database_access2003_chs.msm
(KeyCode MSM 处理 Crystal Decisions 密钥号码的安装,注意是添加合并模块,否则没有“MergeMouduleProperties”属性)
* Crystal_regwiz2003.msm
(如果报表文件使用了 ADO.NET 的 dataset 数据集对象,那么 VC_User_CRT71_RTL_X86_---.msm 和 VC_User_STL71_RTL_X86_---.msm 模块也必须包含在安装工程中。而且这两个模块的文件安装属性的"Module Retargetable Folder"项必须修改成为系统目录)
VC_User_CRT71_RTL_X86_---.msm
VC_User_STL71_RTL_X86_---.msm
(很多人经常出现查询错误,不妨加上这个)
6.打开解决方案-->右键点击Crystal_regwiz2003.msm的属性,在“MergeMouduleProperties”里的“License Key”填入:AAP5GKS0000GDE100DS(这个是你生成Crystal Report是用到的注册号的密码!)
后来我发现这个无法打开的窗体用了dataset数据集对象
也加了VC_User_CRT71_RTL_X86_---.msm
VC_User_STL71_RTL_X86_---.msm的
就是在两个模块的文件安装属性的"Module Retargetable Folder"项必须修改成为系统目录)
找不到那Module Retargetable Folder,
我想问题有可能出个这儿
不知道哪位还遇到过这种情况
客户的操作系统是XP
开发的机子是2003
但是在我们公司的XP上也能运行
数据库是正确的