Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access the constructor of type: NLog.Web.LayoutRenderers.AspNetRequestValueLayoutRenderer. Is the required permission granted? #34

Closed
304NotModified opened this issue Feb 15, 2016 · 1 comment · Fixed by #35
Labels

Comments

@304NotModified
Copy link
Member

NLog.NLogConfigurationException was unhandled by user code
  HResult=-2146233088
  Message=Cannot access the constructor of type: NLog.Web.LayoutRenderers.AspNetRequestValueLayoutRenderer. Is the required permission granted?
  Source=NLog
  StackTrace:
       at NLog.Internal.FactoryHelper.CreateInstance(Type t)
       at NLog.Config.Factory`2.TryCreateInstance(String itemName, TBaseType& result)
       at NLog.Config.Factory`2.CreateInstance(String name)
       at NLog.Layouts.LayoutParser.ParseLayoutRenderer(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr)
       at NLog.Layouts.LayoutParser.CompileLayout(ConfigurationItemFactory configurationItemFactory, SimpleStringReader sr, Boolean isNested, String& text)
       at NLog.Layouts.SimpleLayout.set_Text(String value)
       at NLog.Layouts.SimpleLayout..ctor(String txt, ConfigurationItemFactory configurationItemFactory)
       at NLog.Internal.PropertyHelper.TryNLogSpecificConversion(Type propertyType, String value, Object& newValue, ConfigurationItemFactory configurationItemFactory)
       at NLog.Internal.PropertyHelper.SetPropertyFromString(Object obj, String propertyName, String value, ConfigurationItemFactory configurationItemFactory)
       at NLog.Config.XmlLoggingConfiguration.ConfigureObjectFromAttributes(Object targetObject, NLogXmlElement element, Boolean ignoreType)
       at NLog.Config.XmlLoggingConfiguration.ParseTargetElement(Target target, NLogXmlElement targetElement)
       at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement)
       at NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String filePath, Boolean autoReloadDefault)
       at NLog.Config.XmlLoggingConfiguration.ParseTopLevel(NLogXmlElement content, String filePath, Boolean autoReloadDefault)
       at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
       at NLog.Config.XmlLoggingConfiguration..ctor(String fileName, Boolean ignoreErrors)
       at NLog.Extensions.Logging.AspNetExtensions.ConfigureNLog(String fileName)
       at NLog.Extensions.Logging.AspNetExtensions.ConfigureNLog(IHostingEnvironment env, String configFileRelativePath)
       at aspnet5application.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in X:\_github\nlog\NLog.Framework.logging\examples\aspnet5application\src\aspnet5application\Startup.cs:line 50
  InnerException: 

@304NotModified
Copy link
Member Author

Got this error and need DI?

See http://stackoverflow.com/a/42101946/201303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant