添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Port 22 , 23 , 449 , 8471 , 8476 , 9471, 9476 are whitelisted from ADF SHIR VM to the DB2 server/database ( AS400 ), telnet to these ports are also successful. However, when we are testing the DB2 linked service wit userID and password, we are getting below error.

Could not load file or assembly 'file:///C:\Program Files\Microsoft OLE DB Provider for DB2\System\Microsoft.ApplicationInsights.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

We have place the Microsoft.ApplicationInsights.dll manually in the location shown in the error, however we are getting below error again. Can anyone just what else is required to make a connection to DB2 server using DB2 linked service ?

The type initializer for 'Microsoft.HostIntegration.Common.TelemetryClient' threw an exception.
Could not load file or assembly 'file:///C:\Program Files\Microsoft OLE DB Provider for DB2\System\Microsoft.ApplicationInsights.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
											

@veerabhadra reddy kovvuri Checking to see if you have got a chance to see my previous response. If so, could you please try the suggestions and let us know how it goes.

Thank you

@veerabhadra reddy kovvuri Welcome to Microsoft Q&A forum and thanks for reaching out here.

From both the error messages, my understanding is that somehow dependent DLL i.e. Microsoft.ApplicationInsights.dll is missing from installation OLEDB provider installation path : C:\Program Files\Microsoft OLE DB Provider for DB2\System

Did you already have OLEDB driver installed on the same SHIR VM or machine before installing Integrated runtime? ADF DB2 connector is built on top of Microsoft OLE DB Provider for DB2. SHIR Installation copies all DLLs include dependencies during installation of Integration runtime. If you already have OLEDB driver on the VM where SHIR is installed, then dependent DLL required by ADF won't be copied. Which can result in such errors.

Resolution Step 1:

In case if you already had OLEDB driver, then uninstall it as well as the Self hosted Integration runtime and then reinstall only the Self Hosted Integration runtime VM which should add the dependent libraries to respective folders and avoid such issues.

Resolution Step 1: In case if the above step 1 didn't work, then please validate step 2 and see if that helps.

Steps to get DLL :

  • Go to nuget package portal : https://www.nuget.org/packages/Microsoft.ApplicationInsights
  • Download package Microsoft.ApplicationInsights
  • Change extension to zip
  • Extract package
  • DLL Microsoft.ApplicationInsights.dll should be present in library : microsoft.applicationinsights.2.17.0\lib\net46
  • Copy this DLL to library : C:\Program Files\Microsoft OLE DB Provider for DB2\System and try again.
  • To make sure it is not related to any other installations on the SHIR VM, you can also try to use a dedicated Azure VM for your SHIR and then try whitelisting the required ports. If that helps to connect successfully, then it confirms that there is something else that was installed in your earlier machine or VM in which SHIR was installed which is causing the issue.

    Hope this info helps. Do let us know how it goes.

    Thank you

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.