Enterprise Library 服务问题

在使用Enterprise Library而没有注册服务的时候会出现这样的问题,"Editing Post "Failed to create instances of performance counter 'Cache Total Turnover Rate' - 请求的性能计数器不是自定义计数器,它必须初始化为只读。"而在有装VS.NET和Enterprise Library的机器上可以调用Bin目录下的InstallService.bat注册服务。而在没有装VS.net的机器则无法执行。可以利用%windir%\Microsoft.NET\Framework\v1.1.4322 目录下的InstallUtil.exe 工具来安装这些服务,模仿InstallService.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

转载于:https://www.cnblogs.com/thx-bj/archive/2006/10/17/531220.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值