none
SSIS SQL Agent job - Error: for each sub folder : The get enumerator method of the for each enumerator RRS feed

  • Question

  • Hi.

    I have a SSIS Package , which runs fine in Visual studio. The package uses a for each file loop and the variable points to a folder like this:

    \\server\d$\foldername\subfolder\

    When I deploy the package on SSMS, when I execute the package I get the following error:

    Error 1: FLC - for each sub folder: Error: The GetEnumerator method of the ForEach enumerator has failed with error 0x80131509 "null" . This occurs when the for each enumerator cannot enumerate
    
    Error 2: FLC - For each sub folder: Error The object in the variable "User: ProductFolderList" does not contain an enumerator.
    

    Below is the code used:

    string folder = Dts.Variables["User::varProcessingFolderLocation"].Value.ToString(); 
    
    Dts.Variables["User::ProductFolderList"].Value = System.IO.Directory.GetDirectories(folder);   
    
    Dts.TaskResult = (int)ScriptResults.Success; 
    

    SSMS version is 2017, visual studio solution is built in 2016 and project configuration is VNext.

    I have verified the permissions of the folder and the ID with which I am running it has full control.

    How to fix this? Thanks

    Tuesday, October 8, 2019 8:34 AM

All replies