微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

用于访问 SPO 列表的 SSIS Visual C# 脚本组件

如何解决用于访问 SPO 列表的 SSIS Visual C# 脚本组件

我已将所有代码写入控制台解决方案中,并且运行良好。当我尝试将该代码作为源引入 SSIS 脚本组件时,我收到以下错误

Script Component Runtime Error

我也包含了我试图测试的一小部分代码。此代码已被修剪到发生错误的地方。我已经在控制台解决方案中测试了这个确切的代码,它执行时没有任何错误

   public override void CreateNewOutputRows()
    {
        string siteURL = "https://XXXXXXXXX.sharepoint.com/XXXXXX";
        string userName = "XXXXXXXXXXXXX";
        string password = "XXXXXXXXXXXXX";

        //Create the client context object and set the credentials  
        ClientContext clientContext = new ClientContext(siteURL);
        securestring securePassword = new securestring();

        foreach (char c in password.tochararray())
            securePassword.AppendChar(c);

        clientContext.Credentials = new SharePointOnlineCredentials(userName,securePassword);

        //Load the web  
        Web web = clientContext.Web;

        clientContext.Load(web);

        List oList = clientContext.Web.Lists.GetByTitle("XXXXXXXXXXXXX");
        clientContext.Load(oList);
        clientContext.ExecuteQuery();

        Output0Buffer.AddRow();
        Output0Buffer.Match = "TRUTH";
    }

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。