.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
satyapriyanayak
SP
abhays
Sasi Prabhu
Post New Web Links

Enterprise Library 5.0 Activation error occured

Posted By:      Posted Date: November 29, 2010    Points: 0   Category :ASP.Net
 

Hi,

       I am using Enterprise Library 5.0,when am run the console application ,i got this error " Activation error occured while trying to get instance of type Database,key 'xxx' ".

 

Thanks

Deivendran




View Complete Post


More Related Resource Links

Microsoft Enterprise Library 5.0 - Logging Application Block Activation Error

  

Hi folks,

I've been writing a class where I wanted to write the errors off to the OS EventLog. I was pointed towards the Logging Application Block. I used LogWriter successfully in a web page and transfer the code to the class so that I could have the functionality there.

I keep getting an {"Activation error occured while trying to get instance of type LogWriter, key \"\""} Error when I reach this line of code:

private LogWriter writer = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();

I had something similar with the daab getinstance call but I added the unity assemblies to the code and this resolved this. I thought this was the issue with this problem.

Could anyone tell me what I'm doing wrong?

Thanks in advance folks.

app.config code:

---------------------------------------

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
&nbs

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

  

Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />
</connectionStrings>


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)


Database myDB=EnterpriseLibraryCo

Enterprise Library 4.0 error: Input string was not in a correct format.

  

I am trying to insert candidates information into SQL Server database. I have written the corresponding stored procedure like below in SQL server:

ALTER PROCEDURE [dbo].[USPInsertCandidate]
	@candidate_name varchar(60),
	@dob datetime,
	@gender char,
	@current_location varchar(60),
	@mobile_no_one varchar(20),
	@mobile_no_two varchar(20),
	@home_phone	varchar(20),
	@work_phone varchar(20),
	@email_id varchar(100),
	@passport varchar(20),
	@as_on_date datetime,
	@file_upload_path varchar(255),
	@availability char,
	@applied_position varchar(30),
	@max_round_id int,
	@certification_comment varchar(2000),
	@source_id int,
	@source_comment varchar(2000),
	@skillset_comment varchar(2000),
	@max_status_id int,
	@total_exp_year int,
	@total_exp_month int,
	@source_date datetime,
	@user_id int,
	@visa varchar(20),
	@qualification varchar(100)
AS
BEGIN
	declare @candidate_id int;
	set @candidate_id = dbo.GetCandidateID();
	insert into candidates(candidate_id, candidate_name, dob, gender, current_location, mobile_no_one, mobile_no_two, home_phone, work_phone, email_id, 
							passport, as_on_date, file_upload_path, availability, applied_position, max_round_id, certification_comment,
							source_id, source_comment, skillset_comment, max_status_id, total_exp_year, total_exp_month, source_date,
							user_id, visa, qualification)
	values

Enterprise library configuration error

  

Hi all, I am using Enterprise Library 4.0, I have  an applications in  which Enterprise Library was used. now when I am trying to open it's dataconfiguration.config file in Enterprise Library, I am getting following error:

Invalid character in the given encoding. Line 2, position 1......

 

can any body tell me why it is happening and how to get this error resolved??

thanks


VseWSS 1.3 Deployment error related to Enterprise LIbrary(Exception Handling block)

  

We are getting the folllowing error while deploying VseWSS 1.3. There seems to be an issue with Exception Handling Block.

There no more detail in log file except for this error as shown below. We did a complete reinstall of VS 2008 and VseWSS and Enterprise Library, but the error persist.

Is there some incompatibility issue with VseWSS 1.3 and EL? Has anyone come across this error before:

Error

Microsoft.SharePoint.Tools.Utilities.VSeWSSServiceException

Microsoft.SharePoint.Tools.Utilities.VSeWSSServiceException: VSeWSS Service Error: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, CommonErrorPolicy]) failed: Object reference not set to an instance of an object. (Strategy type ConfiguredObjectStrategy, index 2)

 

Log fil

using EnterpriseLibrary.Data gives error as "Activation error occured while trying to get instance o

  

Hi,

I am using the "Microsoft.Practices.EnterpriseLibrary.Data" version "5.0.414.0". I am using VS 2010.

I have added connectionstring entry in the web.config, and I am able to access the database using SQL Server 2008 R2.

I have added the below line in my code to use the database:

 

using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;

public class A1
{
public DataSet GetTableData()
{
Database db = null;
db = DatabaseFactory.CreateDatabase("Connection String Name");
}
}

However, I am getting an error as:

"Activation error occured while trying to get instance of type Database, key". It breaks in CreateDatabase line.

How to fix this?

Thank you


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

  

Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />
</connectionStrings>


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>("MYCON2"); --> Error message, see below


Activation e

MVC + Enterprise Library

  

Not a MVC specific question, but as that's what I'm doing I thought I'll post here.

While looking into the source code of an existing application, I stumbled upon MS Enterprise Library, and as I only heard about these "application block" stuff decided to look into it.

From the theory it sounds like a pretty usefull thing and it made me wonder if other's are using it succesfully along with MVC projects (I know they are not really related!)?

Pro's and Con's? 

I like the database block, as I did not get to any real database development the last 1.5 years, for instance. (Bad excuse I know).  Having an IoC thrown in there (Unity) sounds like I can pretty much stop using 3rd party libraries like I do now all over the place.


Using the ConsoleTraceListener with the Enterprise Library 3.1 Logging Block

  

I'm new to using the Logging application block.  I think I have a pretty good handle on how things work.  However, I'm running into a problem.  I'm using the RollingFlatFileListener and I have formatted the logging template to be more like the logging we are replacing.  However, in our console apps when the ConsoleTraceListener is added it still logs it out in the default text template format.  Is there any way to get around this?  Currently it looks like I will have to create a new TraceListener called FormattedConsoleListener that allows a text formatter to be associated with it.  Is this the only way?


Data Truncation issue with Enterprise Library Logging WriteLog stored Proc

  

Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.

 

Thanks In Advance.


Using Enterprise Library for first time

  

Hi,

I wan to use the enterprise library for the first time. Is there any samples, quick start guide or ebook is available for a quick start and learn the basics.

I have vs2008, so which version of EL should I use?

And if somebody can just brief about Enterprise Library. Because as per my understanding, is this a mixture of design patterns and some pre-made blocks of source code.

 

Thanks.

 

 


Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks

  

Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006


Data Points: The Enterprise Library Data Access Application Block, Part 3

  

E nterprise applications can have a wide variety of data update requirements. Sometimes you need to save multiple rows of changes at once within a single transaction. Other times, the user must be allowed to enter multiple rows of data, send them to the database in a batch; and if a row or two fails, only the rows that succeeded should be committed and remain committed.

John Papa

MSDN Magazine October 2005


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend