hmwillett
(Hannah Willett 🏳️🌈⚧)
July 31, 2023, 7:56pm
1
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 :
hmwillett
(Hannah Willett 🏳️🌈⚧)
July 31, 2023, 8:29pm
3
Mark_Wonsil:
Still .NET 6?
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.
i did not try .NET 6 server with linqpad, but just from looking on the screen I can tell, that you will have to rewrite this.
easy part - settings are now in host.config, not web.config
.NET (Core) does not use AppDomain at all.
Also Configuration manager was changed beween .NET Framework and .NET Core.
So probably it would be easier to start from scratch - create new .NET project and try to use ERP DataModel first, then add additional code you need.
(also, just in case, it should be linqp…
.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
hmwillett
(Hannah Willett 🏳️🌈⚧)
January 23, 2024, 3:02pm
7
CSG had originally customized the file.
I sent it back to them and they fixed it.