Simple vb.net code works in VS 2009 But not VS 2010
I'm attempting to check if a folder contains files or not (empty) using Script Task. Code works in VS 2009, but get 'Exception has been thrown by target of invocation'. I've been trying everything and searching the net with no luck. Please help: Public Sub Main() If Directory.GetFiles(Dts.Variables("strSourceFolderFilePath").Value).Length = 0 Then Dts.Variables("User::boolInd").Value = True End If End Sub variable'strSourceFolderFilePath' is read only. 'boolInd' is read/write.