Config in DLL project

2 posts, 0 answers
  1. Nathan
    Nathan avatar
    13 posts
    Member since:
    Nov 2011

    Posted 05 Dec 2011 Link to this post

    I'm having trouble using a common OA DAL referenced into a dll project.

    I've had no trouble accessing this from windows, web, WPF and console apps however I'm now building an add-on for Autodesk Revit which requires a compiled dll. I've tried varoius approaches none seem to work I get the same error message. Is there a solution for this situation? Thanks.

    System.Configuration.ConfigurationErrorsException: A connection string was referenced by name 'Webbim_nathanConnection' but could not be resolved through the web.config or the executables app.config file.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps, ConnectionPoolType poolType)
       at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(ConnectionString connectionString, Boolean noConnect, PropertySet props, DBDriver& driver, Connection& conn, ConnectionPoolType poolType)
       at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)
       at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
  2. Serge
    Serge avatar
    375 posts

    Posted 07 Dec 2011 Link to this post

    Hello Nathan,

     We are using the standard .NET approach for handling connection strings. And this is storing the connection string in a configuration file. If you open up the context class that is generated by the rlinq file you will see that the default constructor passes the connection string name to the base class. This is  the name of the connection string that the runtime is trying to resolve from the configuration file. 

    Can you make sure that your running application has a connection string with that name in its configuration file. Another solution to this problem would be to pass in the actual connection string to the context constructor, which would make sure that it is not resolved from and needed in the configuration file. 

    I hope this proves to be helpful.

    Kind regards,
    the Telerik team

    Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Back to Top