DEV Community

tackme
tackme

Posted on

1

ASP.NET Coreでwwwroot以下の特定のファイルを発行対象外にする

ASP.NET Coreでは以下のファイルは無条件で発行されるようです。

  • **\*.config
  • **\*.json
  • wwrwroot\*

これらのファイルのうち、特定のファイルを発行対象外に設定するには、csprojファイルに以下のように記述する必要があります。

<Project Sdk="Microsoft.NET.Sdk.Web">
  ...省略...
  <ItemGroup>
    <!-- wwwroot\log以下の全ファイルを発行対象外に設定 -->
    <Content Update="wwwroot\log\*" CopyToPublishDirectory="Never" />
  </ItemGroup>
  ...省略...
</Project>
Enter fullscreen mode Exit fullscreen mode

参考

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay