【发布时间】:2013-03-04 12:08:23
【问题描述】:
我在 WiX 3.7 中编写了一个自定义操作,现在当我想连接到某个地方的数据库(Firebird)时,它只是从函数中返回,我现在已经调试了一个多小时,但无法确定找出问题所在
Database db;
try
{
db = new Database(@"C:\Cedex2\DB\CEDEX.FDB", DatabaseOpenMode.Transact);
Debuging.Log("step0");
}
catch (Exception ex)
{
Debuging.Log(ex.Message);
}
try
{
string sqlScript = "";
Debuging.Log("step1");
using (StreamReader reader = new StreamReader(@"C:\Cedex2\DB\script1.sql"))
{
try
{
sqlScript = reader.ReadToEnd();
}
catch (Exception ex)
{
Debuging.Log(ex.Message);
}
}
Debuging.Log(sqlScript);
db.Execute(sqlScript);
Debuging.Log("step2");
db.Close();
Debuging.Log("closed");
}
catch (Exception ex)
{
Debuging.Log(ex.Message);
}
脚本存在,数据库文件也存在。在记录(“step0”)之前必须发生一些事情,因为这不会出现在我的记录文件中。如果我在 new Database() 之前手动抛出异常,它将进入捕获并记录。有什么问题?如果是编译器错误,为什么它没有出现在我的捕获中?
在运行自定义操作后,数据库文件也没有新的 Windows-Lastmodified 日期
【问题讨论】:
标签: exception wix wix3.5 wix3 wix3.6