gpt4 book ai didi

c# - 无法加载文件或程序集,因为 'Access is denied'(标识 : NETWORK SERVICE)

转载 作者:行者123 更新时间:2023-11-30 17:55:46 25 4
gpt4 key购买 nike

加载项目时出现以下错误。应用程序池标识设置为“网络服务”。“NETWORK SERVICE”作为“安全权限”对下面提到的 ASP.NET TEMP 目录具有完全访问权限。我应该怎么做才能解决以下问题?

 Could not load file or assembly 'EPi247.Selvbetjening.Templates' or one of its dependencies. Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'EPi247.Selvbetjening.Templates' or one of its dependencies. Access is denied.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'EPi247.Selvbetjening.Templates' could not be loaded.


Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = EPi247.Selvbetjening.Templates
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: EPi247.Selvbetjening.Templates | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/repo/projects/OppdalCMS6R2Empty/
LOG: Initial PrivatePath = C:\repo\projects\OppdalCMS6R2Empty\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\repo\projects\OppdalCMS6R2Empty\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/1725e370/13a5a0c6/EPi247.Selvbetjening.Templates.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/1725e370/13a5a0c6/EPi247.Selvbetjening.Templates/EPi247.Selvbetjening.Templates.DLL.
LOG: Attempting download of new URL file:///C:/repo/projects/OppdalCMS6R2Empty/bin/EPi247.Selvbetjening.Templates.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated.

最佳答案

如果您的站点使用模拟,负载可能会在用户帐户下发生(而不是 AppPool 进程的帐户)。您可以在异常时刻通过检查 Environment.UserName 来确认。

如果是这种情况,您需要确保触发程序集加载的代码在进程帐户下运行(所有其他需要文件系统访问权限的操作也是如此)。

关于c# - 无法加载文件或程序集,因为 'Access is denied'(标识 : NETWORK SERVICE),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14736483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com