从SSIS脚本任务创建对自定义程序集的引用-vb [英] Creating a reference to a custom assembly from an SSIS Script Task - vb

查看:89
本文介绍了从SSIS脚本任务创建对自定义程序集的引用-vb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在我的SSIS脚本任务中创建导入Newtonsoft.Json.Linq"的方法,但这显然不像在SSIS中管理NuGet包"那样简单.那么还有另一种解决方法.

I am looking for a way to create an "Imports Newtonsoft.Json.Linq" in my SSIS script task, but this is apparently not as simple as a "manage NuGet Packages" in SSIS. So is there another way around this.

我找到了

I have found a link to what looks to me like a possible solution, but as I am no skilled programmer, I am having trouble translating from C# into vb. I am hoping that there is someone out there that can help me, or perhaps guide me in another direction.

我正在使用Visual Studio 2010 Shell,.Net Framework 4.6.0,并且公司代码语言为vb.

I am using Visual Studio 2010 Shell, .Net Framework 4.6.0, and the company code language is vb.

这是上面链接中的C#代码的副本. :

Here is a copy of the C# code from the link above. :

[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
     static ScriptMain()
     {
         AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
     }
     static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
     {
         if (args.Name.Contains("ssisHelper"))
         {
             string path = @"c:\temp\";
             return System.Reflection.Assembly.LoadFile(System.IO.Path.Combine(path, "ssisHelper.dll"));
         }
         return null;
     }
    . . .

推荐答案

您必须将Newtonsoft.Json dll文件添加到以下目录

You have to add Newtonsoft.Json dll file to the following directories

(1).Net Framework dll目录

 C:\Windows\Microsoft.NET\Framework\v[.net installed version]\ 

示例

C:\Windows\Microsoft.NET\Framework\v4.0.30319\

(2)SQL Server数据工具dll运行时目录

C:\Program Files (x86)\Microsoft SQL Server\[SQL Server version]\DTS\Binn

示例

C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn


然后,在脚本任务"中,转到项目资源管理器",然后将其添加为参考,它将出现在列出的参考中.


After that, in the Script Task, go to project explorer, you and then add this dll as a reference, it will appear in the references listed.

这篇关于从SSIS脚本任务创建对自定义程序集的引用-vb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆