Enterprise Library Data Access Application Block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to get data access to an SQL Server from a .NET class library running under AutoCAD 2011. I'm using Microsofts Enterprise Library Data Access Application Block (DAAB). The data acces is in a separate assembly, that have worked perfectly well for similar add-in scenarios under Word, Excel and Visio. In these scenarios, I just had to make sure that a xxx.dll.config file existed in the folder where the Add-In assembly was deployed. The config file contains:
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
</configSections>
<dataConfiguration defaultDatabase="AET18"/>
<connectionStrings>
<add name="AET18" connectionString="Database=AET;Server=AET18;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
When initializing I get the error message: Activation error occurred while trying to get instance of type Database, key ""
I have seen this error message before, namely when i failed to place a xx.dll.config file in the directory where the add-in resided. So it seems that the enterprise library can't find the config file and thus can't read the connection strings.
I have tried placing the xx.dll.config file in acad.exe's directory, and I have also tried incorporating the xml in acad.exe.config under a <appSettings> ... </appSettings> tag, but no luck. If I don't place it in these tags AutoCAD refuses to run, saying something about "permission to run" etc.
I know this is maybe more a question to a Enterprise Library discussion group, but I can't seem to find anything as to how the DAAB reads the connection strings, and I was hoping that someone else had tried this.