Hi,
 I have exception when this code is executed:
    foreach (ComponentInfo componentInfo in session.Components)
    {}.

Exeption is:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
Microsoft.Deployment.WindowsInstaller.InstallerException: Function
failed during execution.
  at Microsoft.Deployment.WindowsInstaller.View.Fetch()
  at Microsoft.Deployment.WindowsInstaller.View.<GetEnumerator>d__0.MoveNext()
  at 
Microsoft.Deployment.WindowsInstaller.ComponentInfoCollection.<GetEnumerator>d__0.MoveNext()
  at RemotingCA.SampleCAs.InstallRemotingConfigurationData(Session session)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle._InvokeMethodFast(Object target,
Object arguments, SignatureStruct& sig, MethodAttributes
methodAttributes, RuntimeTypeHandle typeOwner)
  at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
Object arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
  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, Int64 remotingDelegatePtr)


I looked on source code of "ComponentInfoCollection" class and found
that method GetEnumerator missing "compView.Execute()" command before
"foreach (Record compRec in compView) using (compRec). row.

       public IEnumerator<ComponentInfo> GetEnumerator()
       {
           using (View compView = this.session.Database.OpenView(
               "SELECT `Component` FROM `Component`"))
           {

///////////////////// Missing code ////////////////
/////// compView.Execute();
/////////////////////////////////////////////////////////
               foreach (Record compRec in compView) using (compRec)
               {
                   string comp = compRec.GetString(1);
                   yield return new ComponentInfo(this.session, comp);
               }
           }
       }

I don't have VS2008, so I can not recompile DTF, but I think this is a
problem why I receive exception.


Thanks,
Dima

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to