on 2024 Aug 15 9:58 AM
I'm pleased to see the new update for the .NET Core NCo connector. However, during testing, I encountered a problem.
The following exception was thrown:
'The type initializer for 'SAP.Middleware.Connector.RfcDestinationManager' threw an exception'
at SAP.Middleware.Connector.RfcConfigParameters..ctor() in D:\depot\bas\789_REL\gen\optU\ntamd64\krn\rfc\nco3\krn\rfc\nco3\sapnco\RfcConfiguration.cs 802
I'm using the same configuration parameters in .NET Framework 4.6.2, and they work fine. Regarding the new test environment:
.NET 8.0
Console Application
References added + manually included ijwhost.dll (as instructed in the installation manual)
Any hint how to resolve this problem?
Are you running your application inside Visual Studio in debug mode?
Then you need to change the debugger settings and disable that VS breaks when this type of exception is thrown. NCo tries to find out, in which kind of environment it is running (Console App, ASP.NET app, Azure, etc) and trying to detect this may cause an internal exception being thrown by the .NET runtime, however NCo catches this and then continues "as normal". Only Visual Studio doesn't realize that the exception is handled later and triggers an "Exception-Breakpoint" when a type initializer exception is thrown...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I'm running the application inside Visual Studio in debugging mode. I'm not sure which debugger setting I need to change to be honest. Can you please elaborate the steps?
I disabled 'System.TypeInitializationException' from Exception Settings but it still doesn't work. Here is entire exception:
The type initializer for 'SAP.Middleware.Connector.RfcConfigParameters' threw an exception.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
File name: 'System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at SAP.Middleware.Connector.RfcConfigParameters.LoadConfiguration()
at SAP.Middleware.Connector.RfcConfigParameters..cctor() in D:\depot\bas\789_REL\gen\optU\ntamd64\krn\rfc\nco3\krn\rfc\nco3\sapnco\RfcConfiguration.cs:line 926
Below is my test code:
Ok, that looks like an entirely different problem:
"System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=5.0.0.0"
Can it be, that your .NET Core installation is incomplete or corrupt? The missing file is (or should be) part of the Microsoft .NET Core Runtime.
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.