on 07-08-2021 10:04 PM
I've created a console application with .NET Framework 3.1, connector 3.0 64 bits from here
https://support.sap.com/en/product/connectors/msnet.html
and when I tried to run this code I had an error:
RfcConfigParameters rfcPar = new RfcConfigParameters();
rfcPar.Add(RfcConfigParameters.AppServerHost, "xxxx");
rfcPar.Add(RfcConfigParameters.Client, "xxxxx");
rfcPar.Add(RfcConfigParameters.User, "xxxx");
rfcPar.Add(RfcConfigParameters.Password, "xxxxx");
rfcPar.Add(RfcConfigParameters.SystemNumber, "xxxxx");
rfcPar.Add(RfcConfigParameters.Language, "xxxxx");
RfcDestination dest2 = RfcDestinationManager.GetDestination(rfcPar);
try
{
dest2.Ping();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
System.TypeInitializationException: 'The type initializer for 'SAP.Middleware.Connector.RfcConfigParameters' threw an exception.'
TypeLoadException: Could not load type 'System.ServiceModel.Activation.VirtualPathExtension' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Anyone could help me? Thanks!
Per the exception content a .NET Framework 4.x is loaded. Could you double-check which .NET Framework version your console application project is targeting? Also check that the NCo library version you installed is matching the .NET Framework version you are targetting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.