Microsoft.Practices.EnterpriseLibrary.Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I found from http://forums.asp.net/853053/ShowPost.aspx that the Microsoft
Data Application Block (EDRA) require InstallUtil.exe to be run on
Microsoft.Practices.EnterpriseLibrary.Data.dll in order to get around the
following errors:
Event Type: Error
Event Source: Enterprise Library Instrumentation
Event Category: None
Event ID: 0
Date: 08/08/2005
Time: 11:39:35
User: N/A
Computer: MyComputer
Description:
Failed to create instances of performance counter 'Average Command Execution
Time' - The requested Performance Counter is not a custom counter, it has to
be initialized as ReadOnly..

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

On a development Server, I am getting a further unhandled exception that I
can't Create EventSource for the above error.

As I don't have admin access to the IIS server, on which the ASP.NET that
utilies the Data EDRA reside, are there any way around the problems?
 
Hi Patrick,

If I recall properly, you have to rebuild EDRA without instrumentation
(without a conditional compilation definition - not sure which one, I guess
it should be deducted from its name) so the problems (and instrumentation)
will go away.
 
Not quite understand.

I searched for "#if" in the EDRA project for
Microsoft.Practices.EnterpriseLibrary.Data and don't seem to find any
references to do with compilation switch to do with instrumentation.

However, there are lots of references to instrumentation in the Database
class (instrumentation private variable, for a start!)

To my recollection, the EDRA DLLs I got were the one pre-compiled/supplied
with the MSI file for Enterprise Library V2.

Does anyone in Microsoft know how to resolve the problem?

Miha Markic said:
Hi Patrick,

If I recall properly, you have to rebuild EDRA without instrumentation
(without a conditional compilation definition - not sure which one, I guess
it should be deducted from its name) so the problems (and instrumentation)
will go away.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

Patrick said:
I found from http://forums.asp.net/853053/ShowPost.aspx that the Microsoft
Data Application Block (EDRA) require InstallUtil.exe to be run on
Microsoft.Practices.EnterpriseLibrary.Data.dll in order to get around the
following errors:
Event Type: Error
Event Source: Enterprise Library Instrumentation
Event Category: None
Event ID: 0
Date: 08/08/2005
Time: 11:39:35
User: N/A
Computer: MyComputer
Description:
Failed to create instances of performance counter 'Average Command
Execution
Time' - The requested Performance Counter is not a custom counter, it has
to
be initialized as ReadOnly..

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

On a development Server, I am getting a further unhandled exception that I
can't Create EventSource for the above error.

As I don't have admin access to the IIS server, on which the ASP.NET that
utilies the Data EDRA reside, are there any way around the problems?
 
I did however, find the following in
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvents:

internal static CounterCreationData[] Counters = new CounterCreationData[]
{
new CounterCreationData(SR.NumConnPerSec,
SR.NumConnPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumConnFailPerSec,
SR.NumConnFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumCmdsPerSec,
SR.NumCmdsPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumCmdsFailPerSec,
SR.NumCmdsFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransOpenPerSec,
SR.NumTransOpenPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransFailPerSec,
SR.NumTransFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransCommitPerSec,
SR.NumTransCommitPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransAbortPerSec,
SR.NumTransAbortPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.AvgCmdTime, SR.AvgCmdTimeMsg,
PerformanceCounterType.AverageTimer32),
new CounterCreationData(SR.TotalCmd, SR.TotalCmdMsg,
PerformanceCounterType.AverageBase)
};

internal enum CounterIndex : int
{
ConnectionOpenned = 0,
ConnectionFailed = 1,
CommandExecuted = 2,
CommandFailed = 3,
TransactionOpenned = 4,
TransactionFailed = 5,
TransactionCommitted = 6,
TransactionRolledBack = 7,
AvgCommandExecuteTime = 8,
TotalCommandExecuted = 9
}

Wondering if I could recompile the EDRA commenting them out?

However, I can't compile the project



Patrick said:
Not quite understand.

I searched for "#if" in the EDRA project for
Microsoft.Practices.EnterpriseLibrary.Data and don't seem to find any
references to do with compilation switch to do with instrumentation.

However, there are lots of references to instrumentation in the Database
class (instrumentation private variable, for a start!)

To my recollection, the EDRA DLLs I got were the one pre-compiled/supplied
with the MSI file for Enterprise Library V2.

Does anyone in Microsoft know how to resolve the problem?

Miha Markic said:
Hi Patrick,

If I recall properly, you have to rebuild EDRA without instrumentation
(without a conditional compilation definition - not sure which one, I guess
it should be deducted from its name) so the problems (and instrumentation)
will go away.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

Patrick said:
I found from http://forums.asp.net/853053/ShowPost.aspx that the Microsoft
Data Application Block (EDRA) require InstallUtil.exe to be run on
Microsoft.Practices.EnterpriseLibrary.Data.dll in order to get around the
following errors:
Event Type: Error
Event Source: Enterprise Library Instrumentation
Event Category: None
Event ID: 0
Date: 08/08/2005
Time: 11:39:35
User: N/A
Computer: MyComputer
Description:
Failed to create instances of performance counter 'Average Command
Execution
Time' - The requested Performance Counter is not a custom counter, it has
to
be initialized as ReadOnly..

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

On a development Server, I am getting a further unhandled exception that I
can't Create EventSource for the above error.

As I don't have admin access to the IIS server, on which the ASP.NET that
utilies the Data EDRA reside, are there any way around the problems?
 
Having commented out the following together with code references to the
following array or array indexes, and recompiled the above EDRA, I still get
the same error!

Patrick said:
I did however, find the following in
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvents:

internal static CounterCreationData[] Counters = new CounterCreationData[]
{
new CounterCreationData(SR.NumConnPerSec,
SR.NumConnPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumConnFailPerSec,
SR.NumConnFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumCmdsPerSec,
SR.NumCmdsPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumCmdsFailPerSec,
SR.NumCmdsFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransOpenPerSec,
SR.NumTransOpenPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransFailPerSec,
SR.NumTransFailPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransCommitPerSec,
SR.NumTransCommitPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.NumTransAbortPerSec,
SR.NumTransAbortPerSecMsg, PerformanceCounterType.RateOfCountsPerSecond32),
new CounterCreationData(SR.AvgCmdTime, SR.AvgCmdTimeMsg,
PerformanceCounterType.AverageTimer32),
new CounterCreationData(SR.TotalCmd, SR.TotalCmdMsg,
PerformanceCounterType.AverageBase)
};

internal enum CounterIndex : int
{
ConnectionOpenned = 0,
ConnectionFailed = 1,
CommandExecuted = 2,
CommandFailed = 3,
TransactionOpenned = 4,
TransactionFailed = 5,
TransactionCommitted = 6,
TransactionRolledBack = 7,
AvgCommandExecuteTime = 8,
TotalCommandExecuted = 9
}

Wondering if I could recompile the EDRA commenting them out?

However, I can't compile the project



Patrick said:
Not quite understand.

I searched for "#if" in the EDRA project for
Microsoft.Practices.EnterpriseLibrary.Data and don't seem to find any
references to do with compilation switch to do with instrumentation.

However, there are lots of references to instrumentation in the Database
class (instrumentation private variable, for a start!)

To my recollection, the EDRA DLLs I got were the one pre-compiled/supplied
with the MSI file for Enterprise Library V2.

Does anyone in Microsoft know how to resolve the problem?

Miha Markic said:
Hi Patrick,

If I recall properly, you have to rebuild EDRA without instrumentation
(without a conditional compilation definition - not sure which one, I guess
it should be deducted from its name) so the problems (and instrumentation)
will go away.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

I found from http://forums.asp.net/853053/ShowPost.aspx that the Microsoft
Data Application Block (EDRA) require InstallUtil.exe to be run on
Microsoft.Practices.EnterpriseLibrary.Data.dll in order to get around the
following errors:
Event Type: Error
Event Source: Enterprise Library Instrumentation
Event Category: None
Event ID: 0
Date: 08/08/2005
Time: 11:39:35
User: N/A
Computer: MyComputer
Description:
Failed to create instances of performance counter 'Average Command
Execution
Time' - The requested Performance Counter is not a custom counter, it has
to
be initialized as ReadOnly..

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

On a development Server, I am getting a further unhandled exception that I
can't Create EventSource for the above error.

As I don't have admin access to the IIS server, on which the ASP.NET that
utilies the Data EDRA reside, are there any way around the problems?
 
Hi Patrick,

I searched around the web. Most people worked around the problem by running
InstallServices.bat.

If that doesn't work for you, could you set some breakpoint in the library
code to see which line does this error generated? Or is the exception
constantly generated when you do certain operation?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
I don't have admin rights on the server so I can't do InstallServices or
InstallUtil.exe

Any other work arounds?
 
Hi Patrick

Currently, I couldn't find other solutions than running the InstallServices
or InstallUtil.exe. Could you get some one who have the admin's privilege
to run this for you?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Alternatively, if I manage to get the Event Source for the following
installed on the IIS Server, what would be the negative impact (if any) of
using the Data EDRA without running InstallUtil.exe on the
Microsoft.Practices.EnterpriseLibrary.Data.dll first?

Event Type: Error
Event Source: Enterprise Library Instrumentation
Event Category: None
Event ID: 0
Date: 08/08/2005
Time: 11:39:35
User: N/A
Computer: MyComputer
Description:
Failed to create instances of performance counter 'Average Command Execution
Time' - The requested Performance Counter is not a custom counter, it has to
be initialized as ReadOnly..
 
Hi Patrick,

I think you can try to run the InstallServices.bat on another machine, on
which you have administrator's privilege, rebuild the enterprise library,
and then copy the .dlls back to your current machine.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
LHi Kevin,

Thanks but confused.......

I thought InstallServices.bat install the DLL's component on the local
machine??

How shall I rebuild the enterprise library?

If I run C:\Program Files\Microsoft Enterprise Library June
2005\src\RebuildLibrary.bat , would that put the binaries at C:\Program
Files\Microsoft Enterprise Library June 2005\bin ?

Why rebuild it *after* running InstallUtil.exe/InstallServices.bat?
 
Btw, running installServices on machine A (WinXP Pro SP1), then rebuilding my
ASP.NET App's Solution (which references the ELAB in C:\Program
Files\Microsoft Enterprise Library June 2005\bin with CopyLocal=True), then
copying all files from machine A to machine B (Windows Server 2003 IIS6.0)
does not solve the problem!
 
Hi Patrick,

Did you attach to the process to check on which line did the error
generated? If you have comment out the code in the library that creates
certain performance counter, and the error still comes out, it seems that
the error was not generated by these lines.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top