The type initializer for 'SvnBridge.Infrastructure.Statistics.ActionTrackingViaPerfCounter' threw an exception.

Mar 2, 2010 at 12:33 PM

I am receiving the following error under Windows Server 2008 and IIS 7.0

 

Access is denied

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: Access is denied

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[Win32Exception (0x80004005): Access is denied]
   System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister) +971082
   System.Diagnostics.PerformanceCounterLib.RegisterCategory(String categoryName, PerformanceCounterCategoryType categoryType, String categoryHelp, CounterCreationDataCollection creationData) +99
   System.Diagnostics.PerformanceCounterCategory.Create(String categoryName, String categoryHelp, PerformanceCounterCategoryType categoryType, CounterCreationDataCollection counterData) +205
   SvnBridge.Infrastructure.Statistics.ActionTrackingViaPerfCounter.CreatePerfCounters(List`1 handlers) +414
   SvnBridge.Infrastructure.Statistics.ActionTrackingViaPerfCounter.TryCreatePerfCounters(List`1 handlers) +77
   SvnBridge.Infrastructure.Statistics.ActionTrackingViaPerfCounter..cctor() +128

[TypeInitializationException: The type initializer for 'SvnBridge.Infrastructure.Statistics.ActionTrackingViaPerfCounter' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.Activator.CreateInstance(Type type) +6
   SvnBridge.Infrastructure.Container.CreateInstance(Type type) +971
   SvnBridge.Infrastructure.<>c__DisplayClass4.<GetAutoCreator>b__3() +92
   SvnBridge.Infrastructure.Container.ResolveType(Type type) +391
   SvnBridge.Infrastructure.Container.Resolve() +89
   SvnBridgeServer.SvnBridgeHttpHandler..ctor() +349

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Web.Configuration.HandlerFactoryCache..ctor(String type) +57
   System.Web.HttpApplication.GetFactory(String type) +78
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +229
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Mar 17, 2010 at 10:35 PM

I get the same message, except with "[Win32Exception (0x80004005): The parameter is incorrect]" instead of "Access is denied". I'm on Win7 x86 with IIS 7.5.

May 11, 2010 at 8:57 AM

Hi,

I got the same problem, can anyone clarify any persmissions issues should be taken into concideration here ?

 

 

Thanks

Amit

May 27, 2010 at 1:01 PM

I got the same problem

Jun 4, 2010 at 1:52 PM
Have you initialized performance counters by SvnBridge.PerfCounter.Installer.exe ?
Jun 11, 2010 at 5:26 AM

Where can i find this file?

Jun 23, 2010 at 7:33 AM

Build it froum sources

http://svnbridge.codeplex.com/SourceControl/changeset/view/51519#220060

Jul 9, 2010 at 8:50 AM
Yes, You should take sources, compile and run SvnBridge.PerfCounter.Installer.exe.
Then you should configure web.config:

1) Make sure the TfsUrl in your web.config is pointed at the correct TFS2010 collection URL (i.e. http://servername:8080/tfs/collectionname)

2) Due to new TFS2010 security restrictions you will need to add a read only account onto your TFS server as follows:

a. Pick an account or create a new account on a domain on which the TFS server will recognize

b. Add that account into the TFS global security list w/ rights to view collection-level info or view server-level info

c. Add read rights to all projects’ source control on the TFS server

d. Add that account into the web.config:


<add key="ReadAllUserDomain" value="" />
<add key="ReadAllUserName" value="" />
<add key="ReadAllUserPassword" value="" />
</appSettings>