Any way to exclude BlazorDebugProxy directory from Release Blazor WASM apps?

Viewed 559

When publishing "Release" builds, the output contains a BlazorDebugProxy folder. That folder is about 18mb. My understanding is this directory contains everything needed to get Chrome to debug Blazor Web Assemblies and I do not want this in my Release/Production builds. I'd like to keep my release builds / deploy tidy. Can I somehow exclude this directory from my publish?

Bonus information: This directory doesn't even respect my csproj specifications, like SatelliteResourceLanguages, for example, even tho is set to en;fr, the BlazorDebugProxy contains a bunch of satellite assemblies for russian, polish, etc...

2 Answers

I managed to do this in net5.0 by adding this to my Blazor WASM host .csproj:

  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <BlazorWebAssemblyOmitDebugProxyOutput>true</BlazorWebAssemblyOmitDebugProxyOutput>
  </PropertyGroup>

Found this property in the build .targets inside the Microsoft.AspNetCore.Components.WebAssembly.Server package

Related