admin管理员组文章数量:1390564
I am receiving the following message in my log file:
'The WebRootPath was not found: C:\inetpub\CondoWebSite\condo11. Static files may be unavailable.' when I try to start my website.
Using IIS10 on windows server 2022. DotNet core 9.0.3
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(
Path.Combine(builder.Environment.ContentRootPath, "condo11")),
RequestPath = "/assets"
});
Note that the startup.cs executes properly (ie connects to SQ and executes initializing code) Full access was given to IUSR, IIS_IUSRS , System, Administrators
Lastly when I try to browse the index.html I get an Http error 404
I am receiving the following message in my log file:
'The WebRootPath was not found: C:\inetpub\CondoWebSite\condo11. Static files may be unavailable.' when I try to start my website.
Using IIS10 on windows server 2022. DotNet core 9.0.3
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(
Path.Combine(builder.Environment.ContentRootPath, "condo11")),
RequestPath = "/assets"
});
Note that the startup.cs executes properly (ie connects to SQ and executes initializing code) Full access was given to IUSR, IIS_IUSRS , System, Administrators
Lastly when I try to browse the index.html I get an Http error 404
Share Improve this question edited Mar 13 at 6:39 Jason 22.5k2 gold badges22 silver badges45 bronze badges asked Mar 12 at 13:20 Guy GallantGuy Gallant 3531 gold badge4 silver badges13 bronze badges1 Answer
Reset to default 0From the error message, it seems that the condo11
folder you created in the project root directory was not included when publishing. You can achieve this with the following code.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>_79503733</RootNamespace>
</PropertyGroup>
<!--Add below settings-->
<ItemGroup>
<None Include="condo11\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
本文标签: aspnet coreError message from IIS 100 The WebRootPath was not foundStack Overflow
版权声明:本文标题:asp.net core - Error message from IIS 10.0 The WebRootPath was not found - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744749980a2623117.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论