Skip to Content
avatar image
Former Member

sapnco 3.0 with .net framework 4.0 web application problem


I have a problem.

I connect to rfc function with sapnco 3.0 in my web application.

First, my code is works fine.

But second time i have this error.

System.ArgumentNullException:Value cannot be null.Parameter name : key at System.Collections.Generic.Dictionary'2.

Find Entry(Tkey key) at System.Collections.Generic.Dictionary'2 TryGetValue(Tkey key,Tvalue& value) at SAPMiddleware.Connector.RfcRepositoryManager.GetRepository

(Rfcdestination destination ) at SAPMiddleware.Connector.RfcDestination.get_Repository() at WebApplication......

Error pointed out by the line below.

Untitledd.png (12.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 30, 2014 at 09:32 AM

    Hello Aysegul,

    the pattern you are using is wrong. Do not register a IDestinationConfiguration within your web application code but within a more central place. A check for null when looking up a destination is simply invalid. null is returned whenever a destination is not found in the IDestinationConfiguration implementation that is registered or in the default one. In case it is not there it means it is not configured and you need to throw an exception that this destination is required for your application.

    If you do the IDestionationConfiguration in a central place the exception should no longer occur.

    Best regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Hynek,

      actually, metadata pools and application pools are completely separated. Best approach is to specify a REPOSITORY_USER and corresponding REPOSITORY_PASSWD so that metadata connections are using a user with limited premissions only. Nevertheless, you are right. Using 1 as MAX_POOL_SIZE is a problem, when using it for a destination used in a multithreaded application ...

      Best regards,