I tried to find files located in the root project of my Blazor Client WebAssembly project. While it works when executed locally on my computer, it doesn\'t work when hosted on A
The reason for this problem is that the TextFile.txt
file was not included at the time of publication.
Akos said is right. I am modifying the .csproj
file to send out my answer. Can better help other users of the forum.
You can paste code in your .csproj
file.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ResolvedFileToPublish Include="TextFile.txt">
<RelativePath>TextFile.txt</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
</Project>
Then you can deploy your app. You can find TextFile.txt
under D:\home\site\wwwroot>
.