简体   繁体   English

在已部署的SSIS包中使用HtmlAgilityPack异常已被抛出

[英]HtmlAgilityPack exception has been thrown when used in deployed SSIS package

Trying to read from: sqlserverbuilds.blogspot.com/ 尝试读取:sqlserverbuilds.blogspot.com/

Using VS 2017 (15.6.4), leveraging C#, with HtmlAgilityPack 1.7.4, deployed to my OS2016 SSIS Server 使用VS 2017(15.6.4),并利用C#和HtmlAgilityPack 1.7.4将其部署到我的OS2016 SSIS服务器

When these commands run: 这些命令运行时:

var html = @"http://sqlserverbuilds.blogspot.com/";
HtmlWeb web = new HtmlWeb();
var htmlDoc = web.Load(html);

I always get: 我总是得到:

Exception has been thrown by the target of an invocation. 调用的目标已引发异常。

I ensured the HTMLAgilityPack.dll was deployed to the GAC correctly and validated such as: 我确保将HTMLAgilityPack.dll正确部署到GAC并经过验证,例如:

C:\...\gacutil>gacutil -l HtmlAgilityPack
Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies: 全局程序集缓存包含以下程序集:

HtmlAgilityPack, Version=1.7.4.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL

Number of items = 1

When testing within VS2017 it runs fine, w/o error or issue (after I registered it to the GAC). 在VS2017中进行测试时,它运行正常,没有错误或问题(在我将其注册到GAC之后)。

So, this was a huge oversight on my part. 因此,这对我来说是一个巨大的疏忽。 Walking through the Log4Net install suggestion for SSIS helped greatly. 遍历SSIS的Log4Net安装建议很有帮助。

It seems that I registered the dll's on the DB Server, but the standalone SSIS server did not have the dll's registered. 看来我在数据库服务器上注册了该dll,但独立的SSIS服务器没有该dll的注册。 I suspect it was the SSIS Server side that my problems were coming from. 我怀疑问题出在SSIS服务器方面。

On a side note, so that I did not need to install anything special to use the "gacutil.exe", I copied from my local computer (which has VS2017 installed) gacutil.exe, gacutil.exe.config, and gacutlrc.dll to a folder on my server. 附带说明一下,为了不需要使用“ gacutil.exe”的任何特殊操作,我从本地计算机(已安装VS2017)复制了gacutil.exe,gacutil.exe.config和gacutlrc.dll到我服务器上的文件夹。 With those 3 files, I was able to register the HtmlAgilityPack.dll without issue. 使用这3个文件,我可以毫无问题地注册HtmlAgilityPack.dll。 Command executed: gacutil -I HtmlAgilityPack.dll 执行的命令:gacutil -I HtmlAgilityPack.dll

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用ActionNameSelectorAttribute时会引发异常“尚未为控制器配置安全性” - Exception “Security has not been configured for controller” is thrown when ActionNameSelectorAttribute is used 在 SSIS 中的 C# 脚本中抛出异常 - Exception has been thrown in C# Script in SSIS 调用的目标已引发异常(SSIS & WinSCP & C#) - Exception has been thrown by the target of an invocation (SSIS & WinSCP & C#) SSIS:调用目标已抛出错误异常 - SSIS: Error Exception has been thrown by the target of an invocation 调用的目标已引发异常 - SSIS 脚本任务错误 - Exception has been thrown by the target of an invocation - SSIS Script Task Error 通过SQL Server代理在SSIS包中运行的C#脚本有时会触发调用目标抛出的异常 - C# script run in SSIS package through SQL Server Agent sometimes triggers Exception has been thrown by the target of an invocation SSIS 脚本任务获取“调用目标已抛出异常”。 使用第 3 方 dll 运行时 - SSIS Script Task getting "Exception has been thrown by the target of an invocation." when running with 3rd party dll 运行时,调用的目标已引发异常 - Exception has been thrown by the target of an invocation When Running 使用Tesseract ocr时,调用目标抛出了异常 - Exception has been thrown by the target of an invocation when using Tesseract ocr SSIS 脚本任务 Excel 连接打开:调用目标抛出异常 - SSIS Script Task Excel connection open: Exception has been thrown by the target of an invocation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM