用于访问 SPO 列表的 SSIS Visual C# 脚本组件
SSIS Visual C# Script Component to access SPO List
我已将所有代码写入控制台解决方案,并且运行良好。当我尝试将该代码作为源代码引入 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";
}
我找到了解决办法。我决定看看 OData 源会有什么样的运气,并开始出现验证错误。我发现这是由于 DotNet 4.6 没有默认为 TLS1.2 的问题,解决方案应该是创建 2 个注册表项。可以在这里找到详细信息。
谢谢大家的帮助。
亲切的问候
我已将所有代码写入控制台解决方案,并且运行良好。当我尝试将该代码作为源代码引入 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";
}
我找到了解决办法。我决定看看 OData 源会有什么样的运气,并开始出现验证错误。我发现这是由于 DotNet 4.6 没有默认为 TLS1.2 的问题,解决方案应该是创建 2 个注册表项。可以在这里找到详细信息。
谢谢大家的帮助。
亲切的问候