由于自定义操作调用,安装程序失败

时间:2014-09-07 13:16:08

标签: wix wix3.5 wix3.7

情况如下: 当我在调试模式(VS2013)中编译时,在临时文件夹中,我看到创建的LOG文件有以下错误:

FXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIF661.tmp-\
SFXCA: Binding to CLR version v4.0.30319
Calling custom action GlobalCustomActions!GlobalCustomActions.CustomActions.CheckInputParameters
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'GlobalCustomActions.CustomActions' threw an exception. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at GlobalCustomActions.CustomActions..cctor()
   --- End of inner exception stack trace ---
   at GlobalCustomActions.CustomActions.CheckInputParameters(Session session)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
   at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
CustomAction caCheckInputParameters returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 15:56:17: caCheckInputParameters. Return value 3.
Action ended 15:56:17: INSTALL. Return value 3.
Action ended 15:56:17: ExecuteAction. Return value 3.
Action ended 15:56:17: INSTALL. Return value 3.

如果我在Release中编译,相同的代码运行良好,自定义操作执行得很好。

另一个输入:此代码在调试模式之前编译并运行良好。

我确保useLegacyV2RuntimeActivationPolicy设置为true,并且支持两个框架。

0 个答案:

没有答案