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

2sxc HotBuild未登录用户编译权限异常求助

2sxc HotBuild 未登录用户初始编译权限异常问题

摘要

2sxc HotBuild功能仅允许未注册用户在已注册用户触发初始代码编译后编译应用代码,否则会抛出权限错误。

问题详情

  • 登录DNN(无论是否拥有管理员权限)访问应用所在页面时,HotBuild可成功编译代码;修改代码后,在未登录的浏览器中打开页面,HotBuild也能成功编译,此时已注册和未注册用户均可正常编译。
  • 次日登录过期后,以未注册用户身份访问时,2sxc Insights中记录如下错误:

Depth 1 in mscorlib: System.UnauthorizedAccessException: Access to the path 'C:\WINDOWS\TEMP\fcty3lxt\fcty3lxt.tmp' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated() at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile) at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) at ToSic.Sxc.Code.AppCodeCompilerNetFull.GetCompiledAssemblyFromFolder(String[] sourceFiles, String assemblyFilePath) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Core\Dnn\Compile\AppCodeCompilerNetFull.cs:line 109 at ToSic.Sxc.Code.AppCodeCompilerNetFull.GetAppCode(String relativePath, HotBuildSpec spec) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Core\Dnn\Compile\AppCodeCompilerNetFull.cs:line 46

  • 重新登录(普通用户或管理员)后,代码可正常编译,错误消失;站点重启(DNN 设置\服务器\重启应用)后也会出现该问题,需已注册用户触发编译才可恢复。
  • 注:C:\WINDOWS\TEMP下的子目录及.tmp文件名每次编译都会变化。

已尝试的无效解决方法

  • 给站点应用池授予C:\WINDOWS和C:\WINDOWS\TEMP目录的完全控制权限(测试时给所有人完全控制权限也无效)
  • 将C:\WINDOWS\TEMP的目录权限应用到所有子文件夹

系统版本

  • 2sxc: 17.10.00
  • DNN: 9.11.00

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.14 05:36:11