Activation error occured while trying to get instance of type Database, key "RetailData"

Topics: Data Access Application Block
Nov 17, 2012 at 3:39 AM

i am using Enterprice Library 5.0

I have written the code in app.confog as follows

<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="RetailData" />    <connectionStrings>        <add name="RetailData" connectionString="Data Source=.;Initial Catalog=RetailData;Integrated Security=True" providerName="System.Data.SqlClient" />        </connectionStrings> 

 </configuration>

 

and i am trying to to access the Instance like

  _db = DatabaseFactory.CreateDatabase(RS.Retail);

where RS is a Resource file for variable Retail and value is RetailData

i get this: Activation error occured while trying to get instance of type Database, key "RetailData"

 

Please reply me i am trying this from one week .

i got so forums but they are written same things that i have written in my code.

 

Thanks,

Santosh

Nov 17, 2012 at 4:04 AM

The configuration looks OK.  Curious if the Enterprise Library assemblies deployed to the GAC?  If so, then that could be the issue.  Otherwise, if you could provide a sample project to reproduce the issue it would help.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Nov 17, 2012 at 4:21 AM
Hi,

Thanks lots for your quick reply.
here i attached the sample project
I am working in NeniComman Class librarya and DBHelper is the class name.
and that you have explained the GAC issue i am not get.
can you please explain more.

Thanks,
Santosh
Nov 17, 2012 at 4:23 AM
Edited Nov 17, 2012 at 4:23 AM

thanks lots

I sent you mail and attachment.

Nov 17, 2012 at 4:36 AM

I haven't received the email & attachment (yet).  Not sure if you are using the GAC or not but the issue (with a workaround) is here: http://entlib.codeplex.com/workitem/26903.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Nov 22, 2012 at 1:15 AM
Hi,

I have Pasted <runtime>.....</runtime> code in app.config till the same issue .
can you please help me. here i attached again my code.

Thanks,
Santosh


On Sat, Nov 17, 2012 at 11:06 AM, randylevy <notifications@codeplex.com> wrote:

From: randylevy

I haven't received the email & attachment (yet). Not sure if you are using the GAC or not but the issue (with a workaround) is here: http://entlib.codeplex.com/workitem/26903.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Nov 22, 2012 at 4:44 AM

Perhaps you can upload your project to SkyDrive or some other site since I don't seem to be receiving any messages.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Dec 2, 2012 at 4:27 AM

is there any update from above discussion?

Thanks

Dec 2, 2012 at 4:52 AM
santosh89 wrote:

is there any update from above discussion?

Thanks

I'm still waiting for a sample project to reproduce the issue.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com