错误描述:Failed to create instances of performance counter 'Total # of Cache Access Attempts' - 请求的性能计数器不是自定义计数器,它必须初始化为只读
解决方法:
首先在网上搜到这么一段代码,开始没太明白,建了一个bat批处理文件,点击,输出了一段文字,然后提示seccess
但后来发现还是错误
后来又把该bat文件拷贝到要注册的dll文件夹下,运行该文件,在应用程序日志中你会看到如下:已成功加载 Enterprise Library Logging Service (Enterprise Library Logging Service)服务的性能计数器。记录数据含有分配给这个服务的新索引数值。这样的日志描述.这时就可以啦.
不会再出现这个错误啦.
批处理文件bat的内容如下所示:
@SET InstallUtilPath=%windir%\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe
@ECHO.
@ECHO -----------------------------------------------------------------
@ECHO Installing Services for the Caching Application Block
@ECHO -----------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Caching.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Caching.dll
@ECHO.
@ECHO -----------------------------------------------------------------
@ECHO Installing Services for the ConfigurationApplication Block
@ECHO -----------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Configuration.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Configuration.dll
@ECHO.
@ECHO -----------------------------------------------------------------
@ECHO Installing Services for the Cryptography Application Block
@ECHO -----------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll
@ECHO.
@ECHO -----------------------------------------------------------------
@ECHO Installing Services for the Data Access Application Block
@ECHO -----------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Data.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Data.dll
@ECHO.
@ECHO -----------------------------------------------------------------------
@ECHO Installing Services for the Exception Handling Application Block
@ECHO -----------------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
@ECHO.
@ECHO ---------------------------------------------------------------------------------
@ECHO Installing Services for the Logging and Instrumentation Application Block
@ECHO ---------------------------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Logging.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Logging.dll
@ECHO.
@ECHO -----------------------------------------------------------------
@ECHO Installing Services for the Security Application Block
@ECHO -----------------------------------------------------------------
@ECHO.
if Exist Microsoft.Practices.EnterpriseLibrary.Security.dll @%InstallUtilPath% Microsoft.Practices.EnterpriseLibrary.Security.dll
@ECHO.
@ECHO ----------------------------------------
@ECHO InstallServices.bat Completed
@ECHO ----------------------------------------
@ECHO.
@PAUSE