Failed to reference Microsoft.Azure.Cosmos package library in One Identity Scripts

All,

We have a requirement to integrate with Azure Cosmos DB from OneIdentity. Couple of options to integrate:

1.  ADO.NET client which requires a third-party provider like CDATA.

2. Microsoft .Net library for Cosmos 

We have decided to proceed with option 2 due to internal reasons. While trying to use DLLs in the One Identity scripts, it is throwing error stating missing dependencies:

Steps taken:

1. Import DLLs using software loader into One Identity Database

2. Reference namespace in the the scripts to consume methods

Error:

Reference required to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' containing the type '[Object]'. Add one to your project.

Please suggest what is the best way to import package? Would appreciate any help on this?

Parents Reply Children
  • Thanks Markus. I was able to compile code after adding this line.

    It looks like Cosmos library has dependency on "System.Threading.Tasks.Extensions". However, i downloaded library from nuget but seems there is a mismatch. I'm not a core developer... Is there anything you can recommend ?

    Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

  • Thing is, that we are not using the System.Threading.Tasks.Extensions library so you would need to add this libary and other potential dependencies of the Azure Cosmos package as well that are not part of the One Identity Manager 8.1.3 version to the system using the Software Loader.

    What I normally do is to use the System Debugger to create my script in Visual Studio, add the NuGet package there to get all DLL dependencies and then add these DLLs using the SoftwareLoader.

  • I tried your suggestion but i'm still facing issues. The target .Net Framework in the OneIdentity "SystemLibrary" folder is showing as 4.5.2, but it is different on my workstation (4.7.2) with Visual Studio which seems to be real issue.

    On the Microsoft portal, it is mentioned that "V3 .NET SDK" of Azure Cosmos have target framework ".NetStandard 2.0" but on the other hand, "V2 .NET SDK" targets ".NetFrameWork 4.5". 

    Does this means that V2 is the only option from OneIdentity as opposed to V3? 

  • OneIM 8.1.x is using 4.7.2 .NET Framework. Did you freshly install this version or did you migrate from an older one?

    In the latter case, it might be helping to re-create the SystemLibrary folder with the one from the product delivery as older versions used 4.5.2. Please backup any unsaved changes to your files before doing that.

  • We upgraded from v8.0.2 to v8.1.3.

    Once SystemLibrary folder is reflected with 4.7.2, will it work with V3 .NET SDKs?, or i need to play around with V2 SDKs

  • I am unable to comment on any 3rd party library specifically, but I already used .NET Standard 2.0 libaries with 8.1 builds. As I've stated before, 8.1 is based on .NET Framework 4.7.2 which is compatibly to .NET Standard 2.0.

    Thing is, that the .vbproj files from 8.1 are targeting 4.7.2 but the 8.0 does not. That's why my recommendation was to re-create your SystemLibrary folder from scratch based on your 8.1 release.