Geeks With Blogs

News Awarded Microsoft MVP C#.NET - 2007, 2008 and 2009


I am born in Bangladesh and currently live in Melbourne, Australia. I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net)and born in Bangladesh.
I am founder and Chief Executive Officer of
Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. Co-founder and core developer of Pageflakes www.pageflakes.com.
Simplexhub, is on its mission to build a smart virtual community in Bangladesh and recently launched beta realestatebazaar.com.bd an ASP.NET MVC application written in C#.NET.


Some of My Articles
Flexible and Plugin based .Net Application..
Mass Emailing Functionality with C#, .NET 2.0, and Microsoft® SQL Server 2005 Service Broker'
Write your own Code Generator or Template Engine in .NET

Shahed Khan blog
 I started getting the following error in one of the site that I am recently installing ( win 2000, .Net 1.1)

Access to performance data was denied to ASPNET as attempted from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Access to performance data was denied to ASPNET as attempted from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe

System.TypeInitializationException: The type initializer for "Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent" threw an exception. ---> System.Security.SecurityException: Requested registry access is not allowed.
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   at System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex)
   at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
   at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category)
   at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID)
   at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type)
   at Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances.ReportCounterFailure(String message)
   at Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances..ctor(String categoryName, String counterName, Boolean createNewInstance)
   at Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.AddPerformanceCounter(String category, String[] counterNames, Boolean createNewInstance)
   at Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.Initialize(String counterCategory, String[] counterNames, Boolean createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
   at Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent..ctor(String counterCategory, String[] counterNames, Boolean createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
   at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..ctor(String[] counterNames, EventLogIdentifier[] eventLogIds)
   at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent..ctor(String[] counterNames, EventLogIdentifier[] eventLogIDs)
   at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String connectionString)
   at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String connectionString)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper command)
   at Abn.DataAccessLayer.SqlClient.SqlCancerTypeProviderBase.GetAll(TransactionManager transactionManager, Int32 start, Int32 pageLength)
   at Abn.DataAccessLayer.Bases.CancerTypeProviderBase.GetAll()
   at Abn.Facade.AbnOncologyFacade.GetAllCancerType()
   at AbnWebApplication.OncologySearchPage.LoadCancerType()
   at AbnWebApplication.OncologySearchPage.Page_Load(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain()

After doing some googling found couple of direction to solve the problem. Thought I should post all the link for future reference.

http://blogs.msdn.com/tomholl/archive/2005/02/18/376187.aspx
http://scottonwriting.net/sowblog/posts/3406.aspx
http://aspnet.4guysfromrolla.com/articles/022305-1.aspx
http://aspnet.4guysfromrolla.com/articles/030905-1.aspx
http://codebetter.com/blogs/eric.wise/archive/2005/03/21/60163.aspx
http://www.thescripts.com/forum/thread376376.html
http://objectsharp.com/blogs/bruce/archive/2003/12/05/222.aspx
http://support.microsoft.com/default.aspx?scid=kb;en-us;329291

This was giving a hard time even after assigning permission to the registry and following most the resolutions suggested in the above links etc. But at the end rebooting the server probably did the trick and things started working as expected. Posted on Wednesday, August 30, 2006 10:36 PM | Back to top


Comments on this post: Enterprise Library June 2005 Instrumentation Issue

# re: Enterprise Library June 2005 Instrumentation Issue
Requesting Gravatar...
With the Instrumentation I was also getting this error

- <InnerException>
<Message>The type initializer for "Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent" threw an exception.</Message>
<Source>Microsoft.Practices.EnterpriseLibrary.Data</Source>
<StackTrace>at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataConnectionFailedEvent.Fire(String connectionString) at Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed(String connectionString) at Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DBCommandWrapper command) at Abn.DataAccessLayer.SqlClient.SqlLocationProviderBase.GetByLocationKey(TransactionManager transactionManager, Int32 start, Int32 pageLength, Guid locationKey) at Abn.DataAccessLayer.Bases.LocationProviderBase.GetByLocationKey(Guid locationKey) at Abn.Facade.AbnOncologyFacade.GetLocationByKey(Guid locationKey) at AbnWebApplication.JobHelper.ProcessJob(String passKey, String data)</StackTrace>
</InnerException>

and by looking at this line I was a bit misleaded

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataInstrumentationFacade.ConnectionFailed

thinking its a Database Connection Error. But not its still the Permission Issue.

Giving the right permission solves the issue. But I got enough of this and Finally got rid of the Instrumetation Option from the EntLib Libraries. Recompiled the Dlls by tweaking the conditional compilation constants (DEBUG;TRACE;USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER). Good thing is you can keep what you like to keep.

Used the new Dlls and all looks OK now.
Left by Shahed Khan on Oct 06, 2006 3:52 AM

# re: Enterprise Library June 2005 Instrumentation Issue
Requesting Gravatar...
Remember the tweaking of Conditional constants are required only in the "Common" Project.
Left by Shahed Khan on Oct 06, 2006 4:01 AM

Your comment:
 (will show your gravatar)
 


Copyright © Shahed Khan | Powered by: GeeksWithBlogs.net | Join free