Exception has been thrown by the target of an invocation - Directory Get File

Hello,
I am receiving the error below. Does anyone know how to fix? Any help is appreciated. Thank you

Source: Invoke Code

Message: Exception has been thrown by the target of an invocation.

Exception Type: System.Reflection.TargetInvocationException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ----> System.IO.DirectoryNotFoundException: Could not find a part of the path ‘\miapfs01\applications\Web\UIPath\Automation\QA\General Accounting\109.7_Blocked Cost Center Notifications\Exports’.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.CommonInit() at System.IO.FileSystemEnumerableIterator1…ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.Directory.GetFiles(String path)
at UiPathCodeRunner_ac5ea42ce7f047d8ad82c0fe9bf08221.Run(String oldFolderPath, String& oldFileName)
— End of inner ExceptionDetail 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 System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams)
at UiPath.Core.Activities.Workflow.CompilerRunner.Run(Object args)
at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Hi,

As per the error message, this path: ‘\miapfs01\applications\Web\UIPath\Automation\QA\General Accounting\109.7_Blocked Cost Center Notifications\Exports’ do not exists.

Try to add the root in the path, something like
D:\miapfs01\applications\Web\UIPath\Automation\QA\General Accounting\109.7_Blocked Cost Center Notifications\Exports\’.

1 Like

Hi @t131,

welcome to uipath forum.

as @Emman_Pelayo suggested please use the exact path.