using System.IO;
using System.Linq;
string filePath = Dts.Variables["User::DataLoadDir"].Value.ToString();
DirectoryInfo di = new DirectoryInfo(filePath);
FileInfo mostRecentFile = (from f in di.GetFiles().Where(x =>
x.Name.StartsWith("DS_All_users_with_additional_fields_"))
orderby f.CreationTime descending
select f).First();
//The Name property below can be changed to FullName to get the complete file path
Dts.Variables["User::VariableHoldingFileName"].Value = mostRecentFile.Name;
以上内容适用于我的本地计算机,但不适用于lambda处理程序。似乎lambda函数会跳过.listMetrics函数。没有错误。我将具有管理员权限的lambda函数附加到Cloudwatch,因此它应该能够列出指标。
如何进行调试?