gpt4 book ai didi

asp.net - 为什么我的 ASP.NET 4.0 Web 服务因 NetworkService 编译错误而失败,但使用 LocalSystem 却成功

转载 作者:行者123 更新时间:2023-12-04 06:32:00 24 4
gpt4 key购买 nike

我开始收到服务器端编译错误,表明我的 Web 服务的应用程序池的标识无法访问临时 ASP.NET 文件夹中的文件。如果我将应用程序池的标识从 NetworkService 更改为 LocalSystem,问题就会消失。我看不到文件夹上的安全设置有任何问题,我重新运行了 aspnet_regiis -i 没有任何效果。

出现在应用程序错误日志中的完整异常包含在下面,但其要点是:

HttpCompileException
error CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\
Framework\v4.0.30319\Temporary ASP.NET Files\kswsextensionservicesweb\f2efe503\
31c03187\App_global.asax.4gcxry4d.dll' -- 'Access is denied. '

谁能解释为什么?奇怪的是它一直在工作。有些东西变了,但我不知道是什么。
Log Name:      Application
Source: ASP.NET 4.0.30319.0
Date: 3/12/2011 12:41:21 PM
Event ID: 1310
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: NYDMTRAIN01.kayescholer.com
Description:
Event code: 3007
Event message: A compilation error has occurred.
Event time: 3/12/2011 12:41:21 PM
Event time (UTC): 3/12/2011 5:41:21 PM
Event ID: bc285ecdc00941d28070725f55ea24f1
Event sequence: 3
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/ROOT/KSWSExtensionServicesWeb-2-129444252812003152
Trust level: Full
Application Virtual Path: /KSWSExtensionServicesWeb
Application Path: C:\inetpub\wwwroot\KSWSExtensionServicesWeb\
Machine name: NYDMTRAIN01

Process information:
Process ID: 3988
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: HttpCompileException
Exception message: (0): error CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\kswsextensionservicesweb\f2efe503\31c03187\App_global.asax.4gcxry4d.dll' -- 'Access is denied. '
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)



Request information:
Request URL: http://nydmtrain01/KSWSExtensionServicesWeb/Services/KSWSDocumentHistoryService.svc
Request path: /KSWSExtensionServicesWeb/Services/KSWSDocumentHistoryService.svc
User host address: 172.25.43.171
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 6
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: 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)


Custom event details:

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1310</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2011-03-12T17:41:21.000Z" />
<EventRecordID>127544</EventRecordID>
<Channel>Application</Channel>
<Computer>NYDMTRAIN01.kayescholer.com</Computer>
<Security />
</System>
<EventData>
<Data>3007</Data>
<Data>A compilation error has occurred.</Data>
<Data>3/12/2011 12:41:21 PM</Data>
<Data>3/12/2011 5:41:21 PM</Data>
<Data>bc285ecdc00941d28070725f55ea24f1</Data>
<Data>3</Data>
<Data>1</Data>
<Data>0</Data>
<Data>/LM/W3SVC/1/ROOT/KSWSExtensionServicesWeb-2-129444252812003152</Data>
<Data>Full</Data>
<Data>/KSWSExtensionServicesWeb</Data>
<Data>C:\inetpub\wwwroot\KSWSExtensionServicesWeb\</Data>
<Data>NYDMTRAIN01</Data>
<Data>
</Data>
<Data>3988</Data>
<Data>w3wp.exe</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>HttpCompileException</Data>
<Data>(0): error CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\kswsextensionservicesweb\f2efe503\31c03187\App_global.asax.4gcxry4d.dll' -- 'Access is denied. '
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)

</Data>
<Data>http://nydmtrain01/KSWSExtensionServicesWeb/Services/KSWSDocumentHistoryService.svc</Data>
<Data>/KSWSExtensionServicesWeb/Services/KSWSDocumentHistoryService.svc</Data>
<Data>172.25.43.171</Data>
<Data>
</Data>
<Data>False</Data>
<Data>
</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>6</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>False</Data>
<Data> 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)
</Data>
</EventData>
</Event>

最佳答案

虽然错误消息表明问题特定于以下目录中的目录权限:

c:\Windows\Microsoft.NET\
Framework\v4.0.30319\Temporary ASP.NET Files\kswsextensionservicesweb\f2efe503\
31c03187\App_global.asax.4gcxry4d.dll'

检查您是否拥有授予网络服务组的适当/全部权限
C:\WINDOWS\TEMP 和/或 C:\WINDOWS\TMP 目录。

关于asp.net - 为什么我的 ASP.NET 4.0 Web 服务因 NetworkService 编译错误而失败,但使用 LocalSystem 却成功,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5284355/

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