[。NET Core宿主主机权限不足,网络驱动器上的文件

问题描述 投票:0回答:1

我有一个新的.NET Core API,它以完整的.Net框架为目标,因此正在IIS中托管。在Visual Studio中可以很好地在本地工作,在使用IIS的测试环境中也可以,但是将其部署到生产环境中无法正常工作。我可以看到的区别是测试环境具有带有API文件的本地驱动器,并且在IIS中使用UNC路径设置了生产API文件,应用程序池以对网络文件夹具有完全访问权限的域用户身份运行。 API无法启动,并显示以下错误,该错误从事件日志中显示以下消息,包括未能写入日志stdout。但是,如果我将应用程序池设置为以域管理员帐户运行,则一切正常,API可以运行。我当然不能以该用户身份运行,所以我的问题是我在这里缺少什么权限或信任级别。我是.NET Core的新手,所以我不确定可能需要哪些额外的权限。其他完整的.NET Framework网站和服务在此服务器上都可以正常运行,并且其文件在此网络驱动器上。

以下是以非管理员域用户身份运行应用程序池时的事件日志消息。

源的应用程序事件日志:“ IIS AspNetCore模块V2”警告:“无法创建stdoutLogFile \?\ UNC \ fileclstr \ Websites \ WebsiteName \ API \ logs \ stdout_20191205204322_15236.log,ErrorCode ='0x800700a1'。”

源的应用程序事件日志:.NET运行时错误:“应用程序:DistributedServices.WebsiteName.exe框架版本:v4.0.30319说明:由于未处理的异常,进程已终止。异常信息:System.Net.Sockets.SocketException在System.Net.Sockets.Socket..ctor(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType)在Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransport.BindAsync()在Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer + <> c__DisplayClass21_01+<<StartAsync>g__OnBind|0>d[[Microsoft.AspNetCore.Hosting.Internal.HostingApplication+Context, Microsoft.AspNetCore.Hosting, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder+<BindEndpointAsync>d__3.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions+<BindAsync>d__43.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder+AddressesStrategy+<BindAsync>d__2.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder+<BindAsync>d__0.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer+<StartAsync>d__211 [[Microsoft.AspNetCore.Hosting.Internal.HostingApplication + Context,Microsoft.AspNetCore.Hosting,Version = 2.2.0.0,Culture = neutral,PublicKeyToken = adb9793829ddae60]]。MoveNext()在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处在Microsoft.AspNetCore.Hosting.Internal.WebHost + d__26.MoveNext()在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处在Microsoft.AspNetCore.Hosting.WebHostExtensions + d__5.MoveNext()在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处在Microsoft.AspNetCore.Hosting.WebHostExtensions + d__4.MoveNext()在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处在Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(Microsoft.AspNetCore.Hosting.IWebHost)在DistributedServices.WebsiteName.Program.Main(System.String [])“

源的应用程序事件日志:“应用程序错误”错误:“正在故障的应用程序名称:DistributedServices.WebsiteName.exe,版本:1.0.0.0,时间戳:0xf4041a68故障模块名称:KERNELBASE.dll,版本:10.0.14393.3321,时间戳:0x5da7e8d8异常代码:0xe0434352故障偏移量:0x000dc232进程ID故障:0x2bf8错误的应用程序开始时间:0x01d5abaca2aaaf51错误的应用程序路径:\ fileclstr \ Websites \ WebsiteName \ API \ DistributedServices.WebsiteName.exe错误的模块路径:C:\ Windows \ System32 \ KERNELBASE.dll报告ID:c68c4bdd-e46d-4628-8be3-63b1f6cc78dc故障包全名:与程序包相关的应用程序ID错误:“

Application EventLog源:“ IIS AspNetCore模块V2”警告:具有物理根目录'\ fileclstr \ Websites \ WebsiteName \ API \'的应用程序'/ LM / W3SVC / 1 / ROOT / api'无法使用命令行'\启动进程fileclstr \ Websites \ WebsiteName \ API \ DistributedServices.WebsiteName.exe'处于阶段'PostStartCheck',ErrorCode ='0x8027025b',已分配端口38520,retryCounter'1'。“

这里是web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <remove name="aspNetCore" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough">
      <clear />
    </httpErrors>
    <aspNetCore processPath=".\DistributedServices.WebSiteName.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout"  />
  </system.webServer>
</configuration>

谢谢您的任何建议。

Asp.net Core 2.2,红est失控,IIS10,Windows Server 2016。

asp.net-core-2.2 windows-server-2016 iis-10 kestrel-http-server
1个回答
0
投票

这花了很多天,但我终于到了那里。

该用户对\\ fileclstr \ Websites \ WebsiteName \拥有权限,但这似乎还不够,而授予\\ fileclstr \ Websites \的权限,则允许它在IIS进程外模式.NET Core中运行,其目标是完全框架。

谢谢您的评论。

© www.soinside.com 2019 - 2024. All rights reserved.