Select to view content in your preferred language

Error migrating existing 2.x addin to 3.1.x. Could not load System.Configuration.ConfigurationManager

1025
4
Jump to solution
10-10-2023 01:43 PM
TimothySmith6
Occasional Contributor

We are in the process of migrating our existing 2.x AddIns to 3.1.x.  Several addins have migrated just fine.  However we're having a problem upgrading one of them.

I've tried updating it via the Pro Migrate Project tool as well as starting a fresh Addin Project from scratch, and copying files over.  Getting the same error when trying to Debug for both.

TimothySmith6_0-1696969673603.png

I have installed System.Configuration.ConfigurationManager via NuGet.

TimothySmith6_1-1696969823398.png

 

Error apparently being thrown from Module1 Initialize call.  The error details points to FrameworkApplication.cs

System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Source=VersionManagementTools
StackTrace:
at VersionManagementTools.Module1.Initialize() in C:\DevProjects\ArcGISPro\SDKDev_Cloud\ProSDK_VersionManagementTools\SDKAddin\VersionManagementTools\Module1.cs:line 71
at ArcGIS.Desktop.Framework.FrameworkApplication.LoadModule(String id, ModuleRecord record) in ArcGIS.Desktop.Framework\FrameworkApplication.cs:line 5475
at ArcGIS.Desktop.Framework.FrameworkApplication.ProcessModules(Boolean resetModules) in ArcGIS.Desktop.Framework\FrameworkApplication.cs:line 5388
at ArcGIS.Desktop.Framework.FrameworkApplication.ContinueInitializing() in ArcGIS.Desktop.Framework\FrameworkApplication.cs:line 4110
at ArcGIS.Desktop.Framework.FrameworkApplication.OnApplicationReady() in ArcGIS.Desktop.Framework\FrameworkApplication.cs:line 1771
at ArcGIS.Desktop.Framework.FrameworkApplication.<OnStartup>d__161.MoveNext() in ArcGIS.Desktop.Framework\FrameworkApplication.cs:line 1705
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

its a visual studio window accessible when u r running the debugger (see below). Sort modules on "Name".

>>Should I try downgrading my nuget package to 6x?

that sounds like it might do the trick

 

modules-window2.png

 

View solution in original post

4 Replies
CharlesMacleod
Esri Regular Contributor

when I look at the loaded modules for Pro 3.1 on my machine it is using version 6.0.2223 (corresponding to, i assume, the currently supported .NET version for Pro 3x -  .NET 6) and not v7.

 

modules-window.png

 

 

 

0 Kudos
TimothySmith6
Occasional Contributor

Thanks for the quick reply Charlie.

Where are you looking to see that info.

It does look like I have a 6x and a 7x version of the ConfigMgr dll.

Should I try downgrading my nuget package to 6x?

TimothySmith6_0-1696975178865.png

 

0 Kudos
CharlesMacleod
Esri Regular Contributor

its a visual studio window accessible when u r running the debugger (see below). Sort modules on "Name".

>>Should I try downgrading my nuget package to 6x?

that sounds like it might do the trick

 

modules-window2.png

 

TimothySmith6
Occasional Contributor

Charlie Macleod you are a Modern Day Hero!

That seemed to fix it. Although I'm still not sure why it was barking at me to begin with, even before I grabbed the wrong version from Nuget.  

Thanks so much.  Ok, on to the next disaster.....

0 Kudos