Unable to find files located in my root project folder when hosted on Azure

前端 未结 1 384
无人及你
无人及你 2021-01-25 09:45

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

相关标签:
1条回答
  • 2021-01-25 10:17

    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>.

    0 讨论(0)
提交回复
热议问题