NLog en SSRS

142 views
Skip to first unread message

Floris Devriendt

unread,
Jul 25, 2013, 5:35:17 AM7/25/13
to nlog-...@googlegroups.com
Dear all
 
I'm using a Report Definition Customization Extension combined with NLog on my report server (Sequel Server 2012 Reporting Services).
 
In the file rssrvpolicy.config I've added a codegroup for NLog. If I assign it to the FullTrust permission set than everything works. However if I assign to my own set up permission set, then I cannot load anymore reports.
In the logfile I see this:
library!ReportServer_0-2!a98!07/25/2013-11:16:12:: i INFO: RenderForNewSession('/List of databases (1)')
extensionfactory
!ReportServer_0-2!a98!07/25/2013-11:16:12:: e ERROR: Exception caught instantiating Generic RDCE Framework report server extension: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Ibs.Rdce.ReportDefinitionCustomizationExtension' threw an exception. ---> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for nlog: That assembly does not allow partially trusted callers. (c:\program files\microsoft sql server\msrs11.crmdb\reporting services\ReportServer\web.config line 4) ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
   at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
   at
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at
System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at
System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission(Type type)
   at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
   at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
   at
System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
   at
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
The Zone of the assembly that failed was:
MyComputer
The Url of the assembly that failed was:
file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
   
--- End of inner exception stack trace ---
   at
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
   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.Web.HttpContext.GetSection(String sectionName)
   at
System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
   at
System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at
NLog.LogFactory.get_Configuration()
   at
NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey)
   at
NLog.LogManager.GetCurrentClassLogger()
   at
Ibs.Rdce.ReportDefinitionCustomizationExtension..cctor()
   
--- End of inner exception stack trace ---
   
--- End of inner exception stack trace ---
   at
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at
System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.<>c__DisplayClass2.<CreateExtensionObject>b__0()
   at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
   at
System.Security.SecurityContext.runTryCode(Object userData)
   at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at
System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
   at
Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
   at
Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.CreateExtensionObject(Extension extConfig, Boolean typeOnly).
library
!ReportServer_0-2!a98!07/25/2013-11:16:12:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: GenerateRdceSnapshot: null != rdce, Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details.;
 
I  believe it is a permission problem, but I'm not sure. If I include in my permission set all the possible permissions you can have (I think I wrote them all) with "unrestricted" set to "true" then it still doesn't work. Any advice on what permissions it needs?
 
Thanks in advance,
Floris

Kim Christensen

unread,
Jul 25, 2013, 3:26:46 PM7/25/13
to nlog-...@googlegroups.com

What version of NLog are you using?

Reply all
Reply to author
Forward
0 new messages