cancel
Showing results for 
Search instead for 
Did you mean: 

RfcDestinationManager.GetDestination("mysrvr") doesn't work

Former Member
0 Kudos

Hello,

I am using the NCo 3.0 with VS2010 and .Net 4.  I am able to make RFC calls using the following code:

var par = new RfcConfigParameters();

//config par here

....

var dest = RfcDestinationManager.GetDestination(par);

This works fine, and I am able to successfully call my BAPI, and get the date from the resulting table.

--------------

But when I try to configure the destination in my in the App.config file, like this:

<configSections>

  <sectionGroup name="SAP.Middleware.Connector">

   <sectionGroup name="ClientSettings">

    <section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/>

   </sectionGroup>

  </sectionGroup>

</configSections>

<SAP.Middleware.Connector>

  <ClientSettings>

   <DestinationConfiguration>

    <destinations>

     <add NAME="mysrvr"

       USER="sdf" PASSWD="sdf"

       AHOST="sap-xpa-01" CLIENT="100" SYSNR="00"

       MAX_POOL_SIZE="10" IDLE_TIMEOUT="10" LANG="EN"

       />

    </destinations>

   </DestinationConfiguration>

  </ClientSettings>

</SAP.Middleware.Connector>

The instantiate the destination like this:

     RfcDestinationManager.GetDestination("mysrvr"); //throws exception

This code throws an exception, saying that mysrvr can not be found.

I have have tried using the 'App.config' of a Unit Test project, as well as the 'app.config' of a Console Application.  What am I doing wrong here?

Accepted Solutions (0)

Answers (2)

Answers (2)

sunil_bsharma
Discoverer
0 Kudos

I was also facing the similar issue.. However I found that it works with only one destination in config file. It does not supports the multiple destinations.

Former Member
0 Kudos

Hello,

I am experiencing the same problem. Were you able to solve the issue?

Best regards

Sebastian Dorsch

Former Member
0 Kudos

Ok, solved it myself... The problem occured because the application was unable to find the assemblies for NCo. Setting "local copy" to "true" for both dlls (sapnco + sapnco_utils) solved it.

Best regards

Sebastian Dorsch