I have a installer project using Wixtoolset 3.8. This project had been building for 2-3 years with no issues. In the last 6 months it gets this error about 70% of the time when being built by TFS Team Build. The Build account is an admin on the machine.
UNHANDLED EXCEPTIONS FROM PROCESS 1832:
8/20/2018 7:37:54 AM
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access to the path 'C:\Users\svc-TFSBLD-ARGO\AppData\Local\Temp\ssvduzbf\bundle-attached.cab' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
at Microsoft.Tools.WindowsInstallerXml.Common.RecursiveFileAttributes(String path, FileAttributes fileAttribute, Boolean markAttribute)
at Microsoft.Tools.WindowsInstallerXml.Common.DeleteTempFiles(String path, IMessageHandler messageHandler)
at Microsoft.Tools.WindowsInstallerXml.WixBinder.DeleteTempFiles()
at Microsoft.Tools.WindowsInstallerXml.Binder.DeleteTempFiles()
at Microsoft.Tools.WindowsInstallerXml.Binder.Cleanup(Boolean tidy)
at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Main(String[] args)
--- 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.Tools.WindowsInstallerXml.Build.Tasks.WixToolTask.ExecuteToolThread(Object parameters)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
Based on the error message, it should be an authorization issue.
Check below things:
C:\Users\svc-TFSBLD-ARGO\AppData\Local\Temp\ssvduzbf\bundle-attached.cabis existing there.McAfee: Real Time Scanning)You can also try deploying a new agent with the admin user as the build agent service account, then check if that works.