System.Configuration.ConfigurationManager

Working on upgrading our environment to the latest and we’re running into a wall that I’m struggling to figure out.

In our current environment, we have been using System.Configuration.ConfigurationManager.AppSettings[“KeyName”] to grab a file path from the server for use in an Electronic Interface wrapper. This is pulled from web.config.
In 2023.1, that got moved to host.config. Fine, all good, but now it’s yelling at me about the ConfigurationManager and I don’t know why.
Has anyone used this method successfully in 2023? What’s the deal?

Error Received:

It’s there, I swear!

Code in the EI File:

var asmPath = (System.Configuration.ConfigurationManager.AppSettings["AssemblyFileSystem"] ?? "")
                .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

Host.config. I want dis:

Still .NET 6?

.NET 7 might have a change:

Aye. Not sure I want to mess with installing .NET 7 quite yet.

Microsoft has replaced System.Configuration class with IConfiguration interface in .Net Core, or requires you to include it yourself via nuget.

.NET (Core) does not use AppDomain at all. - @Olga

Unsure of the right syntax, but if you spin up Visual Studio, see if you can make a basic .NET 6 Console Application to read an xml.

I think the .NET 6 Core is IConfiguration:

Example App:

3 Likes

If its an EI then perhaps you need a .csproj file and look at some of the examples, maybe its just a matter of adding this back:


11.2.300

You can also get any dlls from nuget and place those dependencies right inside your EI Folder and then just reference it in .csproj.

When Epicor detects a .csproj it will use it, if not it will just compile with basic libraries.

4 Likes

Did you ever get a solution to this? Seems like we were having the exact same error due to the exact same code in the EI File

CSG had originally customized the file.
I sent it back to them and they fixed it. :woman_shrugging:t2: