Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager

mcalucin
Participant
0 Kudos

I've downloaded dotnet_connector_30_tutorial and loaded the files into Visual Studio Community 2022.

I've got it to run up to this point:

But when I select 3, I get the following error:

Any clues on what I'm missing or did wrong?

Thanks.

Regards,

Mel Calucin

1 ACCEPTED SOLUTION

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert

Hello Mel,

if RfcConfigParameters.LoadConfiguration() throws an exception, one possible error cause could be an error in the App.config file, e.g., invalid XML syntax.

I recently had the same problem, when I added a <startup> tag in the wrong location. The following throws the exception you are getting:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<configSections>
...
</configSections>
<SAP.Middleware.Connector>
// ... Logon parameters for NCo
</SAP.Middleware.Connector>
</configuration>

After I moved the <startup> section to the end, the App.config loaded successfully:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
...
</configSections>
<SAP.Middleware.Connector>
// ... Logon parameters for NCo
</SAP.Middleware.Connector>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

(So much for "position independend" XML format...)

Best Regards, Ulrich

1 REPLY 1

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert

Hello Mel,

if RfcConfigParameters.LoadConfiguration() throws an exception, one possible error cause could be an error in the App.config file, e.g., invalid XML syntax.

I recently had the same problem, when I added a <startup> tag in the wrong location. The following throws the exception you are getting:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<configSections>
...
</configSections>
<SAP.Middleware.Connector>
// ... Logon parameters for NCo
</SAP.Middleware.Connector>
</configuration>

After I moved the <startup> section to the end, the App.config loaded successfully:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
...
</configSections>
<SAP.Middleware.Connector>
// ... Logon parameters for NCo
</SAP.Middleware.Connector>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

(So much for "position independend" XML format...)

Best Regards, Ulrich