This is a migrated thread and some comments may be shown as answers.

Config in DLL project

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nathan
Top achievements
Rank 1
Nathan asked on 05 Dec 2011, 07:07 AM
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()

1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 07 Dec 2011, 12:17 PM
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,
Serge
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!

Tags
General Discussions
Asked by
Nathan
Top achievements
Rank 1
Answers by
Serge
Telerik team
Share this question
or