cancel
Showing results for 
Search instead for 
Did you mean: 

NCo 3.1.5.0 SAP.Middleware.Connector.RfcConfigParameters..ctor()

0 Kudos
560

 

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)

  • Platform target x64

 

Any hint how to resolve this problem?

View Entire Topic
Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

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...

0 Kudos

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:
simple testsimple testexceptionexception

referencesreferences

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Even reinstallation of VS and .net 8 didnt help. However, in package manager console I enter the following command: Install-Package System.Configuration.ConfigurationManager