秋天的云

博客园 首页 新随笔 联系 订阅 管理
第一次写blog大家见笑了!希望能给大家帮助
我第一个使用Enterpris Library程序写好已经以后上传到服务器上后出现如下的异常产生:

安全性异常
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。

异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。

堆栈跟踪:

[SecurityException: 不允许所请求的注册表访问权。]
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
   System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex) +443
   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +347
   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category) +21
........  

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances..ctor(String categoryName, String counterName, Boolean createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.AddPerformanceCounter(String category, String[] counterNames, Boolean createNewInstance)   Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.Initialize(String counterCategory, String[] counterNames, Boolean createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)

在服务器上把我的程序进行设置,我把Enterpris Library安装程序在服务器进行安装,安装过程没有出错并很快完成了,但是运行Enterprise Library Configuration还是出错。

我在google找到了蝈蝈俊.net的使用企业库在某些站点会报试图执行安全策略不允许的操作异常的解决方法的文章 ,写的很好,正好是我的问题。我改完程序后,把程序上传到服务器。只是写入Log时,程序还出现上面的异常。我以后找到一个企业库的补丁包,是专门来解决这个问题。现在我把补丁包共享给大家!
https://files.cnblogs.com/gyf19/EnterpriseLibraryRegKeys114322.zip

 

 

 

 

posted on 2005-09-12 09:56  秋天的云  阅读(4072)  评论(4编辑  收藏  举报