(SEH)异常初始化Nlog [英] (SEH)Exception initializing Nlog
问题描述
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屋!