question

SivaMani-0897 avatar image
0 Votes"
SivaMani-0897 asked MichaelHan-MSFT commented

PnP.Framwork for SSIS Script Task

I am working on a requirement - Upload files to SharePoint using Client Id and Secret. I struct at Nuget package usage in SSIS Script Task.

Here what I have tried,

Copied all the DLLs to a location and used below code,


public ScriptMain()
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}

private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string strAssemblies_Location = @"C:\Users\siva.m\Documents\SSIS Helper Packages\2.0\";
return System.Reflection.Assembly.LoadFrom(strAssemblies_Location);
}

then my code to connect SharePoint. It is not working and throwing the below error,

Error: 0x1 at Script Task 1: Could not load file or assembly 'PnP.Framework, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Task failed: Script Task 1

Any help on this issue, Please?

dotnet-csharpoffice-sharepoint-onlinesql-server-integration-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OlafHelper-2800 avatar image
0 Votes"
OlafHelper-2800 answered

Using customer/non-GAC assemblies is in SSIS very limited, the assemblies must be located in SSIS dedicated folder, see
Referencing Other Assemblies in Scripting Solutions


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered MichaelHan-MSFT commented

Hi @SivaMani-0897,

To load an Assembly in a SSIS script task that isn't in the GAC, you could refer to the below articles:

https://docs.microsoft.com/en-us/archive/blogs/dbrowne/how-to-load-an-assembly-in-a-ssis-script-task-that-isnt-in-the-gac

https://blog.matrixpost.net/load-an-custom-assembly-in-sql-server-integration-services-ssis-script-task-that-is-not-or-cannot-be-stored-in-the-gac/

Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.



If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



If the response is helpful, please click "Accept Answer" and upvote it.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SivaMani-0897,

Is there anything update? If my answer is helpful, please click "Accept Answer" and upvote it.

0 Votes 0 ·