Could not load type from assembly - ArcGIS Pro SDK for .NET

231
3
Jump to solution
4 weeks ago
NausicaaMontanari
New Contributor II

Hello,

I'm creating an Add-In for ArcGIS Pro 3.2.2 with Visual Studio 2022 and .NET 6.0 and ArcGIS Pro SDK for .NET; I'm following the guidelines here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-3.0-Migration-Guide#install-pro-and-the-pro-...

I also created some WCF proxy clients to be able to call web services in SOAP: https://learn.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide#how- to-use-the-extension

Everything works if I call my code from a generic executable, but if I call the WCF proxy client from a button of an ArcGIS Pro Add-In I receive the following error: Could not load type 'System.ServiceModel.Channels.IBindingRuntimePreferences' from assembly 'System.ServiceModel.Primitives, Version=4.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

In my project I have to use .NET 6.0 but it seems that ArcGIS Pro uses dlls from an older version: 4.9.0.0.

Instead of loading the classes present in the dll: System.ServiceModel.Primitives.dll of my Nuget Package it uses the dll present in: C:\Program Files\ArcGIS\Pro\bin.

This causes me an error during instantiation WCF proxy client to call my web services.

How can I troubleshoot the problem? Is this a bug?

Thanks very much.

Nausica Montanari

0 Kudos
1 Solution

Accepted Solutions
NausicaaMontanari
New Contributor II

Hi,

I hope so and I will wait confidently.

Thanks

Nausica

 

 

View solution in original post

0 Kudos
3 Replies
UmaHarano
Esri Regular Contributor

Pro will use the dependencies it needs from its bin location. ArcGIS Pro 3.3 will be available in a few weeks. This version of Pro uses updated System.ServiceModel.Primitives.dll - version 6.200.XXX. Can you please try using Pro 3.3 to see if your addin works correctly.

 

 

 

MarcelŠíp
Esri Contributor

Hi @UmaHarano, according to Pro SDK documentation,Pro 3.3 requires .NET 8.  So there seems to be the same type of inconsistency between Pro system requirements (.NET 8 ) and system libraries internally loaded by Pro (6.X).

In my opinion this might cause similar problems as with Pro 3.2. What is the reason for library versions in C:\Program Files\ArcGIS\Pro\bin being different from .NET version required by Pro?

0 Kudos
NausicaaMontanari
New Contributor II

Hi,

I hope so and I will wait confidently.

Thanks

Nausica

 

 

0 Kudos