(SEH)异常初始化Nlog [英] (SEH)Exception initializing Nlog

查看:310
本文介绍了(SEH)异常初始化Nlog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试从Visual Studio开始我正在开发的项目时,我得到错误。它工作正常,直到几个小时前。经过一些轻微的不相关的更改,它从Visual Studio启动时停止工作。从资源管理器运行时工作正常。即使是旧版本的vom版本控制(这部分代码完全相同,没有任何问题),行为方式相同,所以在我的代码中似乎不是一个问题。



Program.cs:第14行的代码如下:




private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();



有关如何解决这个问题的任何想法?



System.TypeInitializationException未处理
Message = ...的类型初始化程序抛出异常。
Source = ...
TypeName = ...
StackTrace:
at .... Main(String [] args)
在System.AppDomain._nExecuteAssembly (RuntimeAssembly assembly,String [] args)
在System.AppDomain.ExecuteAssembly(String assemblyFile,Evidence assemblySecurity,String [] args)
在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean ignoreSyncCtx)
在System.Threading.ExecutionContext.Run (ExecutionContext executionContext,ContextCallback callback,Object state)
在System.Threading.ThreadHelper.ThreadStart()
InnerException:System.Runtime.InteropServices.SEHException
Message =外部组件引发异常。
Source = mscorlib
ErrorCode = -2147467259
StackTrace:
在System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile,SecurityZone&zone,StringHandleOnStack retUrl)
at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence()
在System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType)
在System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType)
在System.Security.Policy.Evidence.GenerateHostEvidence(Type type,Boolean hostCanGenerate)
在System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
在System.Security.Policy.Evidence.GetHostEvidence (Type type,Boolean markDelayEvaluatedEvidenceUsed)
在System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
在System.Security.Policy。 Evidence.GenerateHostEvidence(Type type,Boolean hostCanGenerate)
在System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
在System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
在System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain)上的System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
在System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain,String exePath,String&typeName)
在System.Configuration.ClientConfigPaths..ctor(String exePath,Boolean includeUserConfig)上的
$ System.Configuration.ClientConfigPaths.GetPaths(String exePath,Boolean includeUserConfig)
在系统.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
在System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey ,Boolean getLkg,Boolean checkPermission,Boolean getRuntimeObject,Boolean requestIsHere,Object&result,Object&resultRuntimeObject)
在System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
在System.Configuration.ClientConfigurationSystem.System.Configuration。 Internal.IInternalConfigSystem.GetSection(String sectionName)
在System.Configuration.ConfigurationManager.GetSection(String sectionName)
在NLog.Config.XmlLoggingConfiguration.get_AppConfig()
在NLog.LogFactory.get_Configuration( )
在NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey)
在NLog.LogFactory.GetLogger(String name)
在NLog.LogManager.GetCurrentClassLogger()
在.... C:\ ... \Program.cs中的program..cctor():第14行
InnerException:

解决方案

检查Av的以下帖子伊拉支持网站了解问题的细节和周围的工作。该问题与上次产品更新有关:



http://www.avira.com/en/support-for-business-knowledgebase-detail/kbid/805


I get the error at the end when I try to start a project I'm working on from Visual Studio. It worked fine until a few hours ago. After some minor unrelated changes it stopped working when starting from Visual Studio. It works fine when run from explorer. Even old version vom revision control (where this part of the code is exactly the same and has worked without any problems) behave the same way so it doesn't seem to be a problem in my code.

The code at Program.cs:line 14 is the following:

private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();

Any ideas on how to solve this?

System.TypeInitializationException was unhandled Message=The type initializer for ...' threw an exception. Source=... TypeName=... StackTrace: at ....Main(String[] args) at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Runtime.InteropServices.SEHException Message=External component has thrown an exception. Source=mscorlib ErrorCode=-2147467259 StackTrace: at System.Security.Policy.PEFileEvidenceFactory.GetLocationEvidence(SafePEFileHandle peFile, SecurityZone& zone, StringHandleOnStack retUrl) at System.Security.Policy.PEFileEvidenceFactory.GenerateLocationEvidence() at System.Security.Policy.PEFileEvidenceFactory.GenerateEvidence(Type evidenceType) at System.Security.Policy.AssemblyEvidenceFactory.GenerateEvidence(Type evidenceType) at System.Security.Policy.Evidence.GenerateHostEvidence(Type type, Boolean hostCanGenerate) at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type) at System.Security.Policy.Evidence.GetHostEvidence(Type type, Boolean markDelayEvaluatedEvidenceUsed) at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType) at System.Security.Policy.Evidence.GenerateHostEvidence(Type type, Boolean hostCanGenerate) at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type) at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext() at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext() at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName) at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath) at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig) at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig) at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at NLog.Config.XmlLoggingConfiguration.get_AppConfig() at NLog.LogFactory.get_Configuration() at NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey) at NLog.LogFactory.GetLogger(String name) at NLog.LogManager.GetCurrentClassLogger() at ....Program..cctor() in C:\...\Program.cs:line 14 InnerException:

解决方案

Check the following post on the Avira support site for details of the problem and a work around. The issue is related to the last product update:

http://www.avira.com/en/support-for-business-knowledgebase-detail/kbid/805

这篇关于(SEH)异常初始化Nlog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆