You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SQL Server Reporting Service初始化失败:无法打开动态生成源文件

本地启动SSRS时动态编译文件无法打开的问题排查与解决建议

问题描述

启动SQL Server Reporting Service(SSRS)时,出现以下错误:

(0): error CS1504: Source file 'c:\Program Files\Microsoft SQL Server Reporting Services\SSRS\reportserver\RSTempFiles\reporting\0de1224a\5ba1101c\App_global.asax.pddxk8z6.0.cs' could not be opened ('Unspecified error ')

该文件为SSRS启动时动态生成的唯一命名文件,当前不存在于指定目录,无法通过手动创建同名文件解决。

完整堆栈跟踪

Failed to initialize the AppDomain:ReportServer_SSRS_0

Exception: System.Web.HttpCompileException

Message: (0): error CS1504: Source file 'c:\Program Files\Microsoft SQL Server Reporting Services\SSRS\reportserver\RSTempFiles\reporting\0de1224a\5ba1101c\App_global.asax.pddxk8z6.0.cs' could not be opened ('Unspecified error ')
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp)
at System.Web.Compilation.BuildManager.CompileGlobalAsax()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel)
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)

已尝试的无效方案

  • 删除RSTempFiles目录下所有内容后重启SSRS;
  • 为SSRS目录授予完全管理员权限;
  • 在"启用或关闭Windows功能"中启用相关.NET Framework选项(.NET Framework 3.5、.NET Framework 4.8高级服务->ASP NET 4.8和WCF Services);
  • 检查Windows防火墙确保未拦截相关操作;
  • 修复/重新安装.NET Framework。

可行解决建议

  • 检查SSRS服务账户权限:确认SSRS运行的服务账户(可通过服务管理器查看,通常为NT SERVICE\ReportServer或自定义账户)对RSTempFiles目录及上级目录拥有读取、写入、修改权限,手动为该账户分配权限后重启服务。
  • 启用IIS相关组件:若系统安装了IIS,确保ASP.NET 4.8、ISAPI Extensions、ISAPI Filters功能完整启用,SSRS动态编译依赖这些组件。
  • 修改临时文件路径:打开SSRS配置管理器,导航到“报表服务器”节点的“高级”选项卡,将“临时文件目录”修改为非系统盘的自定义路径(如D:\SSRS_Temp),避免系统权限限制,修改后重启SSRS。
  • 排查杀毒软件拦截:临时关闭Windows Defender或第三方杀毒软件,或将RSTempFiles目录添加到杀毒软件排除列表,验证是否是杀毒软件拦截了动态文件的生成与读取。
  • 修复/重装SSRS:若以上方案均无效,通过SQL Server安装中心修复SSRS组件,或卸载后重新安装最新版本(操作前备份报表服务器数据库和配置文件)。

内容的提问来源于stack exchange,提问作者Syed Athar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 06:55:15