EnterpriseLibraryJune2005 的问题

EnterpriseLibraryJune2005.exe 成功安装后,但在其它项目引用后,出现错误,信息如下:
“Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent”的类型初始值设定项引发异常,请各位高手提点意见
.
-----------------------------------------------------------------------------------------------------------------------------

有趣的问题,刚查了查,两解决办法:
一是打安装服务补丁,于如下地址下载补丁:
http://www.softitechture.com/discussions/index.html#InstallServices

二是修改注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application 下的RestrictGuestAccess值由1改为0,然后重启。
----------------------------------------------------------------------------

I was able to resolve this by following Craig's advice regarding the registry
setting for guest access to the event log:

In HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
there is a DWORD value called RestrictGuestAccess, change from 1 to 0, then REBOOT.

Also, I ran the InstallServices batch file in the \bin directory of my ASP.NET app. You can download a copy of the batch file that doesn't look for Visual Studio on your server machine here:

http://www.softitechture.com/discussions/index.html#InstallServices

Also, if you read the FAQ you can recompile to disable instrumentation:

"Open up the EnterpriseLibrary.sln and modify the Configuration Properties\Build\Conditional Constants of the EnterpriseLibrary.Common project. Remove the USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER constants. By removing these constants, all of the internal Enterprise Library instrumentation will be disabled. Recompile."

----------------------------------------------------------------------------
Drew - did you run the Install Services script or installutil over the EntLib assemblies? Also WMI is very particular about where the assemblies are located, so you'll need to run the script over the exact assemblies that your app is loading.


The stuff in InstallServices.bat that points to VS2003 is basically there to find

the location of installutil.exe. However installutil can also be found in other locations, such as C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322.

 

On a production machine without VS2003, rather than run InstallServices.bat it is probably safer to run Installutil.exe directly over the EntLib assemblies, eg:

installutil Microsoft.Practices.EnterpriseLibrary.Common.dll
installutil Microsoft.Practices.EnterpriseLibrary.Configuration.dll

... and so on over whatever assemblies your application is using.
---------------------------------------------------------------------------------------------------------------------------
上面还提到,如果打补丁后出现
"Open up the EnterpriseLibrary.sln and modify the Configuration Properties\Build\Conditional Constants of the EnterpriseLibrary.Common project. Remove the USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER constants. By removing these constants, all of the internal Enterprise Library instrumentation will be disabled. Recompile."
错误,重新编译一下即可。

posted on 2005-11-06 14:53  Zeus  阅读(953)  评论(0编辑  收藏  举报

导航