自定义传递UI扩展生成“无效的类名称”错误

时间:2015-05-29 17:48:50

标签: c# reporting-services

我只是编译sample SSRS delivery extension并按照说明将其部署到服务器。当我调用 ReportService2010 ListExtensions网络服务方法时,扩展程序会显示在结果列表中。但是,当我在报表管理器中创建订阅时,只要从可用的传递扩展名的下拉列表中选择打印机传送示例,我就会得到这个错误:

  

无效的班级名称

我在Windows Server 2012 R2上运行SSRS 2012 SP2(11.0.5569.0)。

编辑:我在日志中找到了这个:

事实证明,ReportManager(ASP.NET UI) 会记录到C:\Program Files\Microsoft SQL Server\MSRSxx.MSSQLSERVER\Reporting Services\LogFiles目录。我最初只看到那些文件中的订阅(即服务)相关事件,并假设如果ReportManager记录了,那些文件必须在其他地方。

  

extensionfactory!ReportManager_0-3!53c!06/02 / 2015-16:27:40 :: e ERROR:异常捕获实例化打印机传递示例报表服务器扩展:

     

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

at System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at Microsoft.ReportingServices.Diagnostics.ExtensionClassFactory.<>c__DisplayClass9.<GetExtensionLocalizedName>b__6()
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.GetExtensionLocalizedName(Extension extConfig, Boolean removeFailuresAndContinue)
     

失败的行动是:

     

InheritanceDemand

     

失败的第一个权限的类型是:

     

System.Web.AspNetHostingPermission

     

失败的第一个许可是:

<IPermission class="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Level="Minimal"/>
     

需求是:

<PermissionSet class="System.Security.PermissionSet" version="1">
  <IPermission class="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Level="Minimal"/>
</PermissionSet>
     

失败程序集的授权集是:

<PermissionSet class="System.Security.PermissionSet" version="1">
  <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Execution"/>
  <IPermission class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001009D92F3DD932D20261ADD96F81554DD22E89D6C820CE81177D791891A9415FE8499B0A22270329D737DD29FCF15784BCE44B876E2099FA06B113712581C764E7B033E3F487EA8774CB78CB79FA5951A501F4FA61496F0E07AB2A48020A99435C0F2DE60282540E72CCCB63F05ECEFB90BD542E30EE34AA8005C51F2EC0BF606C0" Name="Microsoft.Samples.ReportingServices.PrinterDeliverySample" AssemblyVersion="1.0.5627.17054"/>
  <IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Url="file:///C:/Program Files/Microsoft SQL Server/MSRS11.MSSQLSERVER/Reporting Services/ReportManager/bin/Microsoft.Samples.ReportingServices.PrinterDeliverySample.DLL"/>
  <IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Zone="MyComputer"/>
</PermissionSet>
     

失败的程序集或AppDomain是:

     

Microsoft.Samples.ReportingServices.PrinterDeliverySample, Version=1.0.5627.17054, Culture=neutral, PublicKeyToken=f0209f2bcebc8576

     

失败的程序集区域是:

     

MyComputer

     

失败的程序集的URL是:

     

file:///C:/Program Files/Microsoft SQL Server/MSRS11.MSSQLSERVER/Reporting Services/ReportManager/bin/Microsoft.Samples.ReportingServices.PrinterDeliverySample.DLL

是的,我觉得有点愚蠢。好的 - 现在我该如何处理这些信息?是时候再次了解Code Access Security ......

2 个答案:

答案 0 :(得分:1)

看看这个:

http://blogs.msdn.com/b/friis/archive/2010/06/09/system-security-securityexception-request-for-the-permission-of-type-system-web-aspnethostingpermission-failed.aspx

尝试将应用程序池标识切换到网络服务。另外,请检查您的DLL以查看是否需要取消阻止,这也在该文章中提到。

答案 1 :(得分:-1)

您能否确认您在报告服务器机器的C:\ windows \ assembly中可用/注册的组件失败。如果没有注册,那么尝试在GAC中安装它&#34;将程序集安装到全局程序集缓存中#34;

Global Assembly Cache