Error LGHT0301: Failed to open the database

你。 提交于 2019-11-30 06:41:58
user2855030

The "Disable the ICE validation" worked for me - just a setting through Visual Studio 2012 in the .Setup.

After studying the WiX source code and running Process Monitor, I found that excluding the build directories from the virus scan is insufficient.

Explanation: When light.exe runs, it creates the target MSI file in a temporary directory. (This file is the database that the LGHT0301 error message refers to.) After light.exe closes the MSI file, ntrtscan.exe opens the MSI file for read access and read-only sharing. Later, in the database validation step, light.exe tries to reopen the MSI file for read/write access, and a sharing violation occurs.

Solution: Exclude the temporary directory from the real-time virus scan. On Windows Server 2008, for example, this directory is C:\Users\«username»\AppData\Local\Temp.

Stephen Connolly

This is a common problem with build processes and antivirus. The scanner will detect the new MSI package and try to scan it. Meanwhile the build process also tries to validate it by running the Internal Consistency Evaluators (ICE) suite and you get a failure because the database has a mutex on it.

You should just remove the virus scan from your build output folders. Alternatively decouple the validation from the Light command so that the antivirus scan relinquishes the MSI handle before you run the ICE validation.

I had the same problem which was actually really related to codepages and language settings of my system.

Adding English input language in Windows' regional settings solved the problem on my German Windows installation.

ari

The real cause was Trend Micro real time scanning!

(The following is only for historical reference)

I followed @Michael Liu answer and solved the problem


I had the same problem.

I am not referring to Codepage (or SummaryCodepage) in any of those tags, or in fact anywhere in the WXS. Putting Codepage="1252" didn't change anything.

Finally, I tried adding

encoding="utf-8"

to the XML tag which previously only had a version='1.0' attribute. This fixed the problem, as described in "Failed to open the database" error. - SOLVED

It was also the antivirus program for me.

An easy way to check if the problem is related to the anti-virus program is to disable the ICE validation in the WiX project setting (using version 3.7). This worked for me, and is a permanent setting now, since in our company you can't change the setting of the antivirus software.

Pavan Kopparthi

This is the most common error I found while using WiX. The easiest solution for this is go to Properties of your project → Tool Settings → (Check) Suppress ICE Validation.

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