none
Using CustomSettings Provider for C# com Interop RRS feed

  • Question

  • I have a C# class library which uses a custom SettingsProvider class

    public class CustomFileProvider : System.Configuration.SettingsProvider
    {
       implementatin code goes here....
    }

    It works fine when i call this library from another C# console application, when i try to use it for com interop and call it from a C++ console application it fails with exception

    Failed to load provider type: SessionStoreClient.CustomFileProvider, SessionStoreClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=348f186469d6389d.
       at System.Configuration.ApplicationSettingsBase.get_Initializer()
       at System.Configuration.ApplicationSettingsBase.CreateSetting(PropertyInfo propInfo)
       at System.Configuration.ApplicationSettingsBase.EnsureInitialized()
       at System.Configuration.ApplicationSettingsBase.get_Properties()
       at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
       at System.Configuration.SettingsBase.get_Item(String propertyName)
       at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
       at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
       at SessionStoreClient.Properties.Settings.get_SSLSecurityMode()
       at SessionStoreClient.SessionStoreProxyImpl.SetProxy(String EndPointAddress)

    I am not sure what is wrong going on here, please help.

    Monday, June 18, 2012 7:17 PM

Answers

  • Nevermind i got it working, copied the class library dll to the calling managed c++ client folder and it worked like a charm.
    • Proposed as answer by Kris444 Tuesday, June 19, 2012 3:08 AM
    • Marked as answer by Mike FengModerator Wednesday, June 20, 2012 9:06 AM
    Monday, June 18, 2012 8:00 PM

All replies

  • CustomFileProvider is a service (probably WCF) which is making a network connection.  I can't tell from the error messages if it is a virtual connection (on the same computer) or trying to connect to a remote server.

    The following line in the error message tells me what I said previously. The endpoint is the service on the computer and the proxy is an IE setting which is also in the registry.

    SetProxy(String EndPointAddress)

    The registry setting that is being searched follows

    PublicKeyToken=348f186469d6389d

    The SessionStoreClient (a client) is part of the service running on the computer.  The client setting is asking to use a proxy to connect to a server (which could be on the same computer or different computer).

    I think the code found the registry setting and then tried to connect to the server and failed.  I would try to use Wireshark to get a trace of the messages that went from the computer to the server over the internet.


    jdweng

    Monday, June 18, 2012 7:56 PM
  • Nevermind i got it working, copied the class library dll to the calling managed c++ client folder and it worked like a charm.
    • Proposed as answer by Kris444 Tuesday, June 19, 2012 3:08 AM
    • Marked as answer by Mike FengModerator Wednesday, June 20, 2012 9:06 AM
    Monday, June 18, 2012 8:00 PM