【发布时间】:2014-09-18 21:41:19
【问题描述】:
我编写了一个 .NET 4 桌面应用程序,在尝试运行 Setup.exe 时,我在日志文件中收到以下错误。
我正在使用带有 Wix 3.7 的 Visual Studio 2012。
MSI (s) (E8:1C) [16:51:54:890]: Invoking remote custom action. DLL: C:\windows\Installer\MSIFECD.tmp, Entrypoint: EncryptConfig
SFXCA: Extracting custom action to temporary directory: C:\windows\Installer\MSIFECD.tmp-\
SFXCA: Binding to CLR version v4.0.30319
Calling custom action SecureConfig!SecureConfig.CustomActions.EncryptConfig
EncryptConfig: Begin
An error occurred creating the configuration section handler for security: Could not load file or assembly 'Order.Configuration.Net' or one of its dependencies. The system cannot find the file specified. (C:\Program Files (x86)\Orbit Order System\Orbit Order System.exe.config line 6)
CustomAction EncryptConfigurationFile returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 16:51:55: InstallFinalize. Return value 3.
我可以确认 `Order.Configuration.Net.dll' 和应用程序配置文件一样存在于目标文件夹中。
这是 app.config 文件:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="backup"
type="OrderConfiguration.BackupConfig, Order.Configuration.Net"/>
<section name="general"
type="OrderConfiguration.GeneralConfig, Order.Configuration.Net"/>
<section name="security"
type="OrderConfiguration.SecurityConfig, Order.Configuration.Net"/>
<-- ** THIS IS LINE 6 **
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<backup configSource="config\backup.config"/>
<general configSource="config\general.config"/>
<security configSource="config\security.config"/>
<connectionStrings>
<clear/>
<add name="OrderDb"
connectionString="Data Source=(local);Initial Catalog=OrbitOrder;
User Id=User;Password=Pass;MultipleActiveResultSets=true;"/>
</connectionStrings>
</configuration>
我还确认config\security.config 存在于目标文件夹中。
我花了三个小时试图弄清楚错误的含义,因为所有文件都实际存在于目标文件夹中。实际上,我从一年前研究的先前解决方案中复制了 WIX 设置,并且该解决方案运行良好,没有任何问题。
失败的自定义操作正在尝试加密security 配置部分。
我无法解释为什么 MSI 在似乎没有任何问题的情况下会抛出 1603 错误。
【问题讨论】:
-
可能您尝试加载的文件名有错误,或者该文件正在使用中而您无法锁定它,或者该文件甚至可能不存在于磁盘上但这取决于您如何使用自己的自定义操作对事物进行排序。另外,您是否在 GAC 中安装了一些东西?
-
我使用完全相同的代码创建了一个测试项目,但仍然出现同样的错误。当我将
Order.Configuration.Net.dll复制到测试程序的bin文件夹时,它起作用了。我发现这很奇怪,因为我去年为一个类似的程序编写了一个 Wix 设置,它运行良好。对于这个新项目,我使用了相同的设置代码,只是去掉了我不需要的部分。
标签: encryption wix windows-installer app-config